public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question about binfmt_elf.c
@ 2010-07-16 20:12 Rob Landley
  2010-07-21 23:30 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Landley @ 2010-07-16 20:12 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Could somebody please update this comment to explain why fiddling with 
strangely protected bss is _not_ an easy way to leak arbitrary amounts of 
uninitalized kernel memory (with whatever previous contents they have) to 
userspace?

    nbyte = ELF_PAGEOFFSET(elf_bss);
    if (nbyte) {
            nbyte = ELF_MIN_ALIGN - nbyte;
            if (nbyte > elf_brk - elf_bss)
                        nbyte = elf_brk - elf_bss;
            if (clear_user((void __user *)elf_bss +
                                    load_bias, nbyte)) {
                    /*
                     * This bss-zeroing can fail if the ELF
                     * file specifies odd protections. So
                     * we don't check the return value
                      */
            }
    }

Just curious.  Reading through the code and trying to understand it...

Rob
-- 
GPLv3: as worthy a successor as The Phantom Meanace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-22  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 20:12 Question about binfmt_elf.c Rob Landley
2010-07-21 23:30 ` Andrew Morton
2010-07-22  1:38   ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox