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? Thanks for any help and kindest regards, --Patrick -- If I'm not here, I've gone out to find myself. If I get back before I return, please keep me here.
Hi patrick :) On Thu, Nov 10, 2011 at 14:43, Patrick Simmons <linuxrocks123@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
participants (2)
-
Mulyadi Santosa -
Patrick Simmons