LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Kees Cook <keescook@chromium.org>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	"Russell King" <linux@arm.linux.org.uk>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will.deacon@arm.com>,
	"Ralf Baechle" <ralf@linux-mips.org>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Martin Schwidefsky" <schwidefsky@de.ibm.com>,
	"Heiko Carstens" <heiko.carstens@de.ibm.com>,
	linux390@de.ibm.com, x86@kernel.org,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Oleg Nesterov" <oleg@redhat.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"David A. Long" <dave.long@linaro.org>,
	"Andrey Ryabinin" <a.ryabinin@samsung.com>,
	"Arun Chandran" <achandran@mvista.com>,
	"Yann Droneaud" <ydroneaud@opteya.com>,
	"Min-Hua Chen" <orca.chen@gmail.com>,
	"Paul Burton" <paul.burton@imgtec.com>,
	"Alex Smith" <alex@alex-smith.me.uk>,
	"Markos Chandras" <markos.chandras@imgtec.com>,
	"Jeff Bailey" <jeffbailey@google.com>,
	"Vineeth Vijayan" <vvijayan@mvista.com>,
	"Michael Holzheu" <holzheu@linux.vnet.ibm.com>,
	"Ben Hutchings" <ben@decadent.org.uk>,
	"Hector Marco-Gisbert" <hecmargi@upv.es>,
	"Borislav Petkov" <bp@suse.de>, "Jan-Simon Möller" <dl9pf@gmx.de>,
	linux-arm-kernel@lists.infradead.org, linux-mips@linux-mips.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 4/5] mm: split ET_DYN ASLR from mmap ASLR
Date: Wed, 04 Mar 2015 15:16:41 +1100	[thread overview]
Message-ID: <1425442601.9084.9.camel@ellerman.id.au> (raw)
In-Reply-To: <1425341988-1599-5-git-send-email-keescook@chromium.org>

On Mon, 2015-03-02 at 16:19 -0800, Kees Cook wrote:
> This fixes the "offset2lib" weakness in ASLR for arm, arm64, mips,
> powerpc, and x86. The problem is that if there is a leak of ASLR from
> the executable (ET_DYN), it means a leak of shared library offset as
> well (mmap), and vice versa. Further details and a PoC of this attack
> are available here:
> http://cybersecurity.upv.es/attacks/offset2lib/offset2lib.html
> 
> With this patch, a PIE linked executable (ET_DYN) has its own ASLR region:
> 
> $ ./show_mmaps_pie
> 54859ccd6000-54859ccd7000 r-xp  ...  /tmp/show_mmaps_pie
> 54859ced6000-54859ced7000 r--p  ...  /tmp/show_mmaps_pie
> 54859ced7000-54859ced8000 rw-p  ...  /tmp/show_mmaps_pie

Just to be clear, it's the fact that the above vmas are in a different
address range to those below that shows the patch is working, right?

> 7f75be764000-7f75be91f000 r-xp  ...  /lib/x86_64-linux-gnu/libc.so.6
> 7f75be91f000-7f75beb1f000 ---p  ...  /lib/x86_64-linux-gnu/libc.so.6


On powerpc I'm seeing:

# /bin/dash
# cat /proc/$$/maps
524e0000-52510000 r-xp 00000000 08:03 129814                             /bin/dash
52510000-52520000 rw-p 00020000 08:03 129814                             /bin/dash
10034f20000-10034f50000 rw-p 00000000 00:00 0                            [heap]
3fffaeaf0000-3fffaeca0000 r-xp 00000000 08:03 13529                      /lib/powerpc64le-linux-gnu/libc-2.19.so
3fffaeca0000-3fffaecb0000 rw-p 001a0000 08:03 13529                      /lib/powerpc64le-linux-gnu/libc-2.19.so
3fffaecc0000-3fffaecd0000 rw-p 00000000 00:00 0 
3fffaecd0000-3fffaecf0000 r-xp 00000000 00:00 0                          [vdso]
3fffaecf0000-3fffaed20000 r-xp 00000000 08:03 13539                      /lib/powerpc64le-linux-gnu/ld-2.19.so
3fffaed20000-3fffaed30000 rw-p 00020000 08:03 13539                      /lib/powerpc64le-linux-gnu/ld-2.19.so
3fffc7070000-3fffc70a0000 rw-p 00000000 00:00 0                          [stack]


Whereas previously the /bin/dash vmas were up at 3fff..

So looks good to me for powerpc.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>

cheers




  reply	other threads:[~2015-03-04  4:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-03  0:19 [PATCH v2 0/5] " Kees Cook
2015-03-03  0:19 ` [PATCH 1/5] arm: factor out mmap ASLR into mmap_rnd Kees Cook
2015-03-09 14:48   ` Russell King - ARM Linux
2015-03-03  0:19 ` [PATCH 2/5] mm: expose arch_mmap_rnd when available Kees Cook
2015-03-09 14:49   ` Russell King - ARM Linux
2015-03-03  0:19 ` [PATCH 3/5] mm: move randomize_et_dyn into ELF_ET_DYN_BASE Kees Cook
2015-03-03  0:19 ` [PATCH 4/5] mm: split ET_DYN ASLR from mmap ASLR Kees Cook
2015-03-04  4:16   ` Michael Ellerman [this message]
2015-03-04 21:13     ` Kees Cook
2015-03-04 23:56       ` Michael Ellerman
2015-03-09 15:13   ` Russell King - ARM Linux
2015-03-03  0:19 ` [PATCH 5/5] mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE Kees Cook
2015-03-09 14:51   ` Russell King - ARM Linux
2015-03-03  7:31 ` [PATCH v2 0/5] split ET_DYN ASLR from mmap ASLR Ingo Molnar
2015-03-03 18:03   ` Kees Cook
2015-03-04  4:20     ` Ingo Molnar
2015-03-09 15:15 ` Russell King - ARM Linux
  -- strict thread matches above, loose matches on Subject: below --
2015-02-27  3:07 [PATCH " Kees Cook
2015-02-27  3:07 ` [PATCH 4/5] mm: " Kees Cook

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=1425442601.9084.9.camel@ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=a.ryabinin@samsung.com \
    --cc=achandran@mvista.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex@alex-smith.me.uk \
    --cc=ben@decadent.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=bp@suse.de \
    --cc=catalin.marinas@arm.com \
    --cc=dave.long@linaro.org \
    --cc=dl9pf@gmx.de \
    --cc=hecmargi@upv.es \
    --cc=heiko.carstens@de.ibm.com \
    --cc=holzheu@linux.vnet.ibm.com \
    --cc=jeffbailey@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux390@de.ibm.com \
    --cc=linux@arm.linux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=luto@amacapital.net \
    --cc=markos.chandras@imgtec.com \
    --cc=oleg@redhat.com \
    --cc=orca.chen@gmail.com \
    --cc=paul.burton@imgtec.com \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vvijayan@mvista.com \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.org \
    --cc=ydroneaud@opteya.com \
    --subject='Re: [PATCH 4/5] mm: split ET_DYN ASLR from mmap ASLR' \
    /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

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).