Thanks£¡<div><br></div><div>It seems that the function do_page_fault() will finally call <a href="http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L125">fast_clear_page()</a> or <a href="http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L336">slow_zero_page()</a> to zero a new physical page for a process. So calling malloc() cannot get a page used by another process which is dead already.</div>
<div><br></div><div>The assemble language is difficult to me, so please tell me if I am wrong.</div><div><br><div class="gmail_quote">2012/1/18 Fredrick <span dir="ltr"><<a href="mailto:fjohnber@zoho.com">fjohnber@zoho.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When you malloc a memory or mmap a MAP_ANON memory, it is virtually allocated. When you read or write to it, the process takes a page fault. The page fault handler zeroes those memory and hands it to the process. So I think there is no leak.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Fredrick</font></span><div><div class="h5"><br>
<br>
On 01/11/2012 04:53 AM, ÏÄÒµÌí wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi,<br>
My tutor asked me to test whether one process leaves information in<br>
memory after it is dead. I tried to search some article about such thing<br>
on the Internet but there seems to be no one discuss about it. And after<br>
that, I tried to write some program in the User Mode to test it, using<br>
fork() to create lots of processes and filling char 'a' into a 102400<br>
bytes char array in each process. Then I used malloc() to get some<br>
memory to seek char 'a' in a new one process or many new processes, but<br>
failed. All memory I malloced was full of zero.<br>
As the man page of malloc said:"The memory is not initialized", I<br>
believe that the memory which was got by malloc() could be used by other<br>
process, and therefor information leakage exists. But how can I test it?<br>
Or where can I get related information?<br>
Thanks!<br>
<br>
<br></div></div><div class="im">
______________________________<u></u>_________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.<u></u>org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.<u></u>org/mailman/listinfo/<u></u>kernelnewbies</a><br>
</div></blockquote>
<br>
<br>
</blockquote></div><br></div>