From owner-freebsd-hackers Wed Feb 17 10:43:59 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (Postfix) with ESMTP id 4000D113A5 for ; Wed, 17 Feb 1999 10:43:48 -0800 (PST) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id LAA11783; Wed, 17 Feb 1999 11:43:48 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp02.primenet.com, id smtpd011583; Wed Feb 17 11:43:38 1999 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id LAA20466; Wed, 17 Feb 1999 11:43:16 -0700 (MST) From: Terry Lambert Message-Id: <199902171843.LAA20466@usr07.primenet.com> Subject: Re: vm_page_zero_fill To: jas@flyingfox.com (Jim Shankland) Date: Wed, 17 Feb 1999 18:43:15 +0000 (GMT) Cc: hackers@FreeBSD.ORG In-Reply-To: <199902170625.WAA25521@biggusdiskus.flyingfox.com> from "Jim Shankland" at Feb 16, 99 10:25:50 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > [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