lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Nov 2007 05:29:35 -0500 (EST)
From:	"Robert P. J. Day" <>
To:	Joonwoo Park <>
Subject: Re: [PATCH 4/4] atm/ambassador: kmalloc + memset conversion to

On Mon, 26 Nov 2007, Joonwoo Park wrote:

> 2007/11/26, Robert P. J. Day <>:
> > i'm not sure the above is a safe thing to do, as you're zeroing that
> > area, then making a function call and assuming, upon entry to the
> > function call, that the caller has done the right thing.  i don't see
> > how you can count on that, depending on who else might want to call
> > that routine and whether they get sloppy about it.  unless you're
> > prepared to guarantee that there will never be another call to
> > setup_dev() from elsewhere.
> Thanks for your response. But setup_dev is static function and only
> amb_init calls it.

i realized that.  but all you can say is that only amb_init() calls
setup_dev() *currently*.  when you're not looking, someone else might
(for whatever reason) call setup_dev() from elsewhere, and *that* call
might not zero that memory area.

IMHO, the only safe transforms of kmalloc+memset -> kzalloc are those
in which the flow of control is unmistakable and invariant.  splitting
that across a function call seems like a dangerous thing to do.
(except, of course, in the case, where the kzalloc() is added inside
the function -- then all callers are entitled to simplify *their*
code.  but that's different.)

in any event, i just thought i'd point it out.  if you're absolutely
sure there will never be another call to setup_dev() from somewhere
else, then, yes, it's safe.


Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists