When Are Free Pages Zeroed?
Mulyadi Santosa
mulyadi.santosa at gmail.com
Thu Nov 10 23:05:40 EST 2011
Hi patrick :)
On Thu, Nov 10, 2011 at 14:43, Patrick Simmons
<linuxrocks123 at netscape.net> wrote:
> I'm looking into the Linux memory management subsystem and need to know
> when freed pages are zeroed. Specifically, are they zeroed just before
> they are reallocated, immediately after they are freed, or sometime
> in-between? Also, what files/functions would I need to modify to change
> this behavior?
I vaguely recall that zeroing is done in (re)-allocation. Thus, during
freeing pages, you just mark it as free and let the allocator handle
it further (perhaps doing block combining--forgot the technical name).
The function that does allocation while zeroing IIRC is kzalloc.
PS: IIRC too, once zero-ing isn't done anywhere. But later, it is
found that it could be a security issue since it might leak sensitive
data.
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
More information about the Kernelnewbies
mailing list