Date: Wed, 17 Feb 1999 18:43:15 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: jas@flyingfox.com (Jim Shankland) Cc: hackers@FreeBSD.ORG Subject: Re: vm_page_zero_fill Message-ID: <199902171843.LAA20466@usr07.primenet.com> In-Reply-To: <199902170625.WAA25521@biggusdiskus.flyingfox.com> from "Jim Shankland" at Feb 16, 99 10:25:50 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> [Terry:] > > Expecting sbrk'ed pages to be zero filled is just *wrong*. > > [John Dyson:] > > Actually, you have to support that on most practical architectures. > > Architectures aside, the *semantics* have always been that newly > sbrk-ed pages are zero-filled. It's been that way since at least > v7. > > I went and looked for chapter and verse on this in the sbrk(2) > man page, and was astonished not to find it. The Solaris > man page mentions it, though, and I'll bet man page archaeologists > can verify my assertion that this goes way, way back. > > Expecting to be able to get away with *not* zero=filling newly > sbrk'ed pages is just *wrong*. It's a security mechanism. Read the old Bell Technical Journal (it has been reprinted tons of times). In general, you are not supposed to program as if you know the implementation details of malloc(). As David Wolfskill pointed out in an aside, AIX initializes sbrk'ed pages to 0xdeadbeef. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902171843.LAA20466>