Date: Tue, 20 Jun 2006 17:05:48 +0200 From: Dan Lukes <dan@obluda.cz> To: freebsd-security@freebsd.org Subject: Re: memory pages nulling when releasing Message-ID: <44980ECC.5000607@obluda.cz> In-Reply-To: <20060620125350.10d0c9ef.nick@nickwithers.com> References: <20060618203903.31161.qmail@web30306.mail.mud.yahoo.com> <44967861.6070509@obluda.cz> <20060620125350.10d0c9ef.nick@nickwithers.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Nick Withers napsal/wrote, On 06/20/06 04:53: >> To Nick: OS doesn't zero on free. > > FreeBSD does*, if the "J" flag is set in _malloc_options / You speak what the libc does, not about OS itself. I can wrote program using brk/sbrk (another libc functions) to manage it's memory. It set the "end margin" of program's data segment. I think it doesn't zero the end of data segment before shrinking. But I need no libc to wrote a program at all ... Well, if we want to speak about OS memory management we need to clarify what the memory we speak of and what exactly we thing saying "free of a memory". > * Alright, it doesn't zero, as such, but will (again, unless > I've misunderstood the malloc(3) man page) initialise each byte > to 0xd0 2006/6/20, Nick Withers <nick@nickwithers.com>: > There's "Z" malloc option that's used to initialise page with zeros > instead of 0xd0 Difference betwen Z and J isn't the fill value only. Z apply for allocations of new memory (when imalloc() called); J apply on changes in allocated block size (e.g. realloc) and free. So 'Z' doesn't "zero on free" but "zero on alloc". Well, things aren't simple as Z implies J ... BTW, Z nor J doesn't imply 'R' despite of text of manual page. Dan -- Dan Lukes SISAL MFF UK AKA: dan@obluda.cz, dan@freebsd.cz,dan@kolej.mff.cuni.cz
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44980ECC.5000607>