From owner-freebsd-hackers Tue Feb 16 14:40:24 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (Postfix) with ESMTP id 7F93A1103F for ; Tue, 16 Feb 1999 14:39:52 -0800 (PST) (envelope-from tlambert@usr08.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id PAA21425; Tue, 16 Feb 1999 15:39:44 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp01.primenet.com, id smtpd021354; Tue Feb 16 15:39:32 1999 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id PAA07971; Tue, 16 Feb 1999 15:39:17 -0700 (MST) From: Terry Lambert Message-Id: <199902162239.PAA07971@usr08.primenet.com> Subject: Re: vm_page_zero_fill To: dyson@iquest.net Date: Tue, 16 Feb 1999 22:39:17 +0000 (GMT) Cc: toasty@home.dragondata.com, hackers@FreeBSD.ORG In-Reply-To: <199902160153.UAA24408@y.dyson.net> from "John S. Dyson" at Feb 15, 99 08:53:03 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 > Userland won't like non-zeroed memory regions. Some of the kernel might > balk at it also. I can understand the kernel assumptions... but user space???? > Alot of code might do something like: > > int foo; > > main() > { > foo += 1; > } > > and expect foo to be equal to 1 instead of being indeterminant. If you turn > vm_page_zero_fill off entirely, then this will be a problem. The kernel code > does things like this also, unfortunately. BSS is supposed to be zeroed on startup. I can see you *maybe* getting the pages for it out of /dev/zero, but /dev/zero would *have* to be special cased, for semantic, not security, reasons. If it's not using /dev/zero, then it should be done in crt0.o, not rely on the kernel to do the job. For the user code assumptions in other places, well, the FreeBSD crt0.o uses sufficiently more stack than the Linux equivalent that Linux programs can use stack variables as if they are zeroed (e.g. the standard Linux programmer trick of an uninitializaed sockaddr_in causes problems on FreeBSD). 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