On Tue, Oct 22, 2002 at 12:01:19PM -0700, Terry Lambert wrote:
> Tony Finch wrote:
> > Terry Lambert <[EMAIL PROTECTED]> wrote:
> > >The FreeBSD malloc guarantees that the pages are zeroed before being
> > >obtained from the system; this is probably the majority of the cost.
> > >It is a security measure, so that you do not leak data from one process
> > >to another through anonymous pages.
> > >
> > >The Linux malloc does not.
> > 
> > Utter bollocks. FreeBSD malloc can be configured to re-initialize memory
> > on every allocation, but this is designed to assist with buggy programs,
> > it is *not* a security measure. Memory obtained from the kernel on *all*
> > unices (including Linux) is zeroed; that is when security matters, not
> > in malloc. This will not affect the relative performance of phk and gnu
> > malloc.
> 
> *before being obtained from the system*.

Linux does that too, and you appeared to be saying that it doesn't which
is clearly wrong for the security reasons that you stated. It therefore
won't affect the relative performance.

> And I didn't say that.  I only said that the pages were zeroed *before
> being obtained from the system*.  This is what you would expect, with
> anonymous memory accessed off /dev/zero.

PHK malloc uses MAP_ANON on FreeBSD, not /dev/zero -- it uses the
latter only if compiled for Solaris.

Tony.
-- 
f.a.n.finch <[EMAIL PROTECTED]> http://dotat.at/
FAIR ISLE: NORTHEAST BACKING NORTH 5 TO 7 INCREASING 7 TO SEVERE GALE 9,
OCCASIONALLY STORM 10 IN EAST. RAIN. MODERATE OR POOR.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to