[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5j+4nmdxTKoRLR49gAd0tsGxk0xhAv+=FnLtaSptx=Zn1w@mail.gmail.com>
Date: Tue, 9 Dec 2014 09:37:33 -0800
From: Kees Cook <keescook@...omium.org>
To: Christian Borntraeger <borntraeger@...ibm.com>
Cc: Hector Marco <hecmargi@....es>,
LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Russell King - ARM Linux <linux@....linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Oleg Nesterov <oleg@...hat.com>,
Andy Lutomirski <luto@...capital.net>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Anton Blanchard <anton@...ba.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack
On Mon, Dec 8, 2014 at 12:09 PM, Christian Borntraeger
<borntraeger@...ibm.com> wrote:
> Am 05.12.2014 um 01:07 schrieb Hector Marco:
>> [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack
>>
>> The issue appears on PIE linked executables when all memory areas of
>> a process are randomized (randomize_va_space=2). In this case, the
>> attack "offset2lib" de-randomizes all library areas on 64 bit Linux
>> systems in less than one second.
>>
>> Further details of the PoC attack at:
>> http://cybersecurity.upv.es/attacks/offset2lib/offset2lib.html
>>
>> PIE linked applications are loaded side by side with the dynamic
>> libraries, which is exploited by the offset2lib attack. Moving away
>> the executable from the mmap_base area (libraries area) prevents the
>> attack.
>>
>> This patch loads the PIE linked executable in a different area than
>> the libraries when randomize_va_space=3.
>>
>> Patch implementation details:
>>
>> - The ELF_ET_DYN_BASE address is used as the base to load randomly
>> the PIE executable.
>>
>> - The executable image has the same entropy than
>> randomize_va_space=2.
> [...]
>> --- a/arch/arm/mm/mmap.c
>> +++ b/arch/arm/mm/mmap.c
> [...]
>> --- a/arch/arm64/mm/mmap.c
>> +++ b/arch/arm64/mm/mmap.c
> [...]
>
>> --- a/arch/x86/mm/mmap.c
>> +++ b/arch/x86/mm/mmap.c
> [...]
>
> FWIW, please note that s390 and power (maybe others?) also have PIE support done differently, e.g.
> commit d2c9dfccbc3 ("[S390] Randomize PIEs") and commit 501cb16d3cfdc ("powerpc: Randomise PIEs")
>
> What I can tell from a quick look both architectures should be fine regarding offsetlib, as they place the executable already in a different section and randomize those differently even with randomize_va_space=2.
>
> Would it make sense to unify the implementations again?
Seems like that would be best. If this is already being done on
non-x86 and non-arm, we should just fix x86 and arm to DTRT. :)
-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