kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: fjohnber@zoho.com (Fredrick)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Does Linux process exist information leakage?
Date: Thu, 19 Jan 2012 22:52:00 -0800	[thread overview]
Message-ID: <4F190F10.9050309@zoho.com> (raw)
In-Reply-To: <CAMjnu2fk+QNx5+b+S+CtdC3EL9X01d5N24jS+SL=YR=c8megWw@mail.gmail.com>

Yes you are right.
Each architecture implements clear_page() differently. Some may just use 
memset. Some may use architecture specific instructions to perform the 
zero-ing faster.

I guess x86's fast_clear_page does that.

-Fredrick

On 01/18/2012 05:27 PM, ??? wrote:
> Thanks?
>
> It seems that the function do_page_fault() will finally call
> fast_clear_page()
> <http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L125> or
> slow_zero_page()
> <http://lxr.oss.org.cn/plain/source/arch/x86/lib/mmx_32.c#L336> to zero
> a new physical page for a process. So calling malloc() cannot get a page
> used by another process which is dead already.
>
> The assemble language is difficult to me, so please tell me if I am wrong.
>
> 2012/1/18 Fredrick <fjohnber at zoho.com <mailto:fjohnber@zoho.com>>
>
>     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.
>
>     -Fredrick
>
>
>     On 01/11/2012 04:53 AM, ??? wrote:
>
>         Hi,
>         My tutor asked me to test whether one process leaves information in
>         memory after it is dead. I tried to search some article about
>         such thing
>         on the Internet but there seems to be no one discuss about it.
>         And after
>         that, I tried to write some program in the User Mode to test it,
>         using
>         fork() to create lots of processes and filling char 'a' into a
>         102400
>         bytes char array in each process. Then I used malloc() to get some
>         memory to seek char 'a' in a new one process or many new
>         processes, but
>         failed. All memory I malloced was full of zero.
>         As the man page of malloc said:"The memory is not initialized", I
>         believe that the memory which was got by malloc() could be used
>         by other
>         process, and therefor information leakage exists. But how can I
>         test it?
>         Or where can I get related information?
>         Thanks!
>
>
>         _________________________________________________
>         Kernelnewbies mailing list
>         Kernelnewbies at kernelnewbies.__org
>         <mailto:Kernelnewbies@kernelnewbies.org>
>         http://lists.kernelnewbies.__org/mailman/listinfo/__kernelnewbies <http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies>
>
>
>
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  parent reply	other threads:[~2012-01-20  6:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 12:53 Does Linux process exist information leakage? 夏业添
2012-01-11 16:23 ` Jonathan Neuschäfer
2012-01-11 16:45 ` Dave Hylands
2012-01-11 17:52   ` Scott Lovenberg
2012-01-12  2:14     ` 夏业添
2012-01-12 17:00     ` Jonathan Neuschäfer
2012-01-16 18:19       ` Scott Lovenberg
2012-01-16 23:45         ` Jonathan Neuschäfer
2012-01-19 14:47           ` Scott Lovenberg
2012-01-16 18:45       ` Greg Freemyer
2012-01-16 20:44         ` Scott Lovenberg
2012-01-12  2:05   ` 夏业添
2012-01-11 18:44 ` Greg Freemyer
2012-01-19 20:23   ` Rik van Riel
     [not found] ` <CAOfVmNFuBCjWb7-5rJaU7ksgcU8LyAW15JiEwa2PigZL3zC0aw@mail.gmail.com>
2012-01-12  2:30   ` 夏业添
2012-01-18  1:53 ` Fredrick
     [not found]   ` <CAOfVmNFN-GLDwkfLKG11iw7-p6KerDmyoMxV1oSD5WSYJMXc0g@mail.gmail.com>
2012-01-18 11:43     ` beyond.hack
2012-01-19  1:27   ` 夏业添
2012-01-19  7:12     ` SaNtosh kuLkarni
2012-01-19  8:37       ` SaNtosh kuLkarni
2012-01-20  6:52     ` Fredrick [this message]
2012-01-19 14:48   ` Scott Lovenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F190F10.9050309@zoho.com \
    --to=fjohnber@zoho.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).