[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5j+Pu-xeCBcMZZqTgLfKss7Er0pfCxp04a4eWDWhuDryTQ@mail.gmail.com>
Date: Wed, 4 Mar 2015 13:13:15 -0800
From: Kees Cook <keescook@...omium.org>
To: Michael Ellerman <mpe@...erman.id.au>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Russell King <linux@....linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Ralf Baechle <ralf@...ux-mips.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
linux390@...ibm.com, "x86@...nel.org" <x86@...nel.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Oleg Nesterov <oleg@...hat.com>,
Andy Lutomirski <luto@...capital.net>,
"David A. Long" <dave.long@...aro.org>,
Andrey Ryabinin <a.ryabinin@...sung.com>,
Arun Chandran <achandran@...sta.com>,
Yann Droneaud <ydroneaud@...eya.com>,
Min-Hua Chen <orca.chen@...il.com>,
Paul Burton <paul.burton@...tec.com>,
Alex Smith <alex@...x-smith.me.uk>,
Markos Chandras <markos.chandras@...tec.com>,
Jeff Bailey <jeffbailey@...gle.com>,
Vineeth Vijayan <vvijayan@...sta.com>,
Michael Holzheu <holzheu@...ux.vnet.ibm.com>,
Ben Hutchings <ben@...adent.org.uk>,
Hector Marco-Gisbert <hecmargi@....es>,
Borislav Petkov <bp@...e.de>,
Jan-Simon Möller <dl9pf@....de>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
Linux MIPS Mailing List <linux-mips@...ux-mips.org>,
linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 4/5] mm: split ET_DYN ASLR from mmap ASLR
On Tue, Mar 3, 2015 at 8:16 PM, Michael Ellerman <mpe@...erman.id.au> wrote:
> 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?
That's correct, yes. I've called this out explicitly now in the 9/10
patch in v4.
>
>> 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..
Fantastic! Thanks very much for testing!
>
> So looks good to me for powerpc.
>
> Acked-by: Michael Ellerman <mpe@...erman.id.au>
I had a question in the powerpc-specific change that may have gone unnoticed:
Can mmap ASLR be safely enabled in the legacy mmap case here? Other archs
use "mm->mmap_base = TASK_UNMAPPED_BASE + random_factor".
Separate from this series, do you happen to know if this improvement
can be made, or if the legacy mmap on powerpc can't handle this?
Thanks!
-Kees
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists