brk's zero-fill behavior on VAXen

Guy Harris guy at sun.uucp
Mon Nov 3 18:24:25 AEST 1986


> In section 2 of the UNIX Programmer's Manual, the description of the "brk"
> and "sbrk" calls note only that they change the system's notion of the
> lowest location not used by the program.  If the result of the call is to
> expand the address space of the process, there's no promise about the
> contents of the newly-available address space.

There is such a promise in the System V page for "brk"/"sbrk"; it promises
that the newly-available space will be zero-filled.

> Can system performance be improved by avoiding zero filling of the new
> memory?

Perhaps, although I suspect not by much.  The same could be said for the
zero-filling of newly-allocated blocks of files.  System *security* is
definitely improved by *not* avoiding this zero-filling; the data you get
from this may be somewhat random, but I wouldn't rely on that guaranteeing
that nobody can extract useful information from it.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy at sun.com (or guy at sun.arpa)



More information about the Comp.unix.wizards mailing list