Re: memory pages nulling when releasing

看板FB_security作者時間19年前 (2006/06/20 23:06), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串22/27 (看更多)
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 _______________________________________________ freebsd-security@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-security To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"
文章代碼(AID): #14c0yH00 (FB_security)
討論串 (同標題文章)
文章代碼(AID): #14c0yH00 (FB_security)