List Info

Thread: memory pages nulling when releasing




memory pages nulling when releasing
user name
2006-06-20 15:05:48
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 <nicknickwithers.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: danobluda.cz, danfreebsd.cz,dankolej.mff.cuni.cz
_______________________________________________
freebsd-securityfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-secu
rity
To unsubscribe, send any mail to
"freebsd-security-unsubscribefreebsd.org"
memory pages nulling when releasing
user name
2006-06-20 17:03:53
On 2006-06-20 17:05, Dan Lukes <danobluda.cz> wrote:
>> 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.

Are you sure?  Then we should fix the manpage.
Cc'ing Jason Evans, who may be interested too.

_______________________________________________
freebsd-securityfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-secu
rity
To unsubscribe, send any mail to
"freebsd-security-unsubscribefreebsd.org"
memory pages nulling when releasing
user name
2006-06-20 17:43:57
Giorgos Keramidas wrote:
> On 2006-06-20 17:05, Dan Lukes <danobluda.cz> wrote:
> 
>>>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.
> 
> 
> Are you sure?  Then we should fix the manpage.
> Cc'ing Jason Evans, who may be interested too.

The man page looks accurate to me.  What aspect of the
descriptions of 
'J' and 'Z' do you think is incorrect?

Thanks,
Jason
_______________________________________________
freebsd-securityfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-secu
rity
To unsubscribe, send any mail to
"freebsd-security-unsubscribefreebsd.org"
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )