am not sure about my answer but regarding kmalloc if i am going out of context ..but when u do a<b> kmalloc it doesnt clear </b>the memory obtained and still holds the prvious contents...what happens in that case ..and as far as i know when u take the case of reparenting ....during process termination &nbsp;exit_mm() is called to release the mm_struct held by this process. If no other process<div>
is using this address space, if the address space is not shared&mdash;the kernel&nbsp;then destroys it and also there is the senario of zombie exit...i mean PDT remains after parent exits....</div><div><br></div><br><div class="gmail_quote">
2012/1/19 ÏÄÒµÌí <span dir="ltr">&lt;<a href="mailto:summerxyt@gmail.com">summerxyt@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks£¡<div>
<br></div><div>It seems that the function do_page_fault() will finally call&nbsp;<a href="http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L125" target="_blank">fast_clear_page()</a>&nbsp;or&nbsp;<a href="http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L336" target="_blank">slow_zero_page()</a>&nbsp;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">&lt;<a href="mailto:fjohnber@zoho.com" target="_blank">fjohnber@zoho.com</a>&gt;</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><font color="#888888"><br>


<br>
-Fredrick</font></span><div><div><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>
Hi,<br>
 &nbsp; &nbsp;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 &#39;a&#39; into a 102400<br>
bytes char array in each process. Then I used malloc() to get some<br>
memory to seek char &#39;a&#39; in a new one process or many new processes, but<br>
failed. All memory I malloced was full of zero.<br>
 &nbsp; &nbsp;As the man page of malloc said:&quot;The memory is not initialized&quot;, 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>
 &nbsp; &nbsp;Thanks!<br>
<br>
<br></div></div><div>
______________________________<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>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><b style="color:rgb(102,102,204)">Regards,<br>Santosh Kulkarni</b><br><br>