[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWGaB-ftJC+6yZtCfmAq50bx5JnxorLDTNyhkGWNN-8yQ@mail.gmail.com>
Date: Mon, 22 Dec 2014 12:13:22 -0800
From: Andy Lutomirski <luto@...capital.net>
To: Jiri Kosina <jkosina@...e.cz>
Cc: Hector Marco Gisbert <hecmargi@....es>,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Pavel Emelyanov <xemul@...allels.com>,
Catalin Marinas <catalin.marinas@....com>,
Heiko Carstens <heiko.carstens@...ibm.com>,
Oleg Nesterov <oleg@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Anton Blanchard <anton@...ba.org>,
Russell King - ARM Linux <linux@....linux.org.uk>,
"H. Peter Anvin" <hpa@...or.com>,
David Daney <ddaney.cavm@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Arun Chandran <achandran@...sta.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Martin Schwidefsky <schwidefsky@...ibm.com>,
Ismael Ripoll <iripoll@...ca.upv.es>,
Christian Borntraeger <borntraeger@...ibm.com>,
Thomas Gleixner <tglx@...utronix.de>,
Hanno Böck <hanno@...eck.de>,
Will Deacon <will.deacon@....com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Kees Cook <keescook@...omium.org>,
Reno Robert <renorobert@...il.com>
Subject: Re: [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack
On Mon, Dec 22, 2014 at 12:03 PM, Jiri Kosina <jkosina@...e.cz> wrote:
> On Mon, 22 Dec 2014, Andy Lutomirski wrote:
>
>> It could be worth having a mode that goes all out: randomize every
>> single allocation independently in, say, a 45 or 46-byte range. That
>> would be about as strong ASLR as we could possibly have, it would
>> result in guard intervals around mmap data allocations (which has real
>> value), and it would still leave plenty of space for big address space
>> hogs like the Chromium sandbox.
>>
>> The main downside would be lots of memory used for page tables.
>
> Plus get_random_int() during every mmap() call.
If that's actually a problem, then I think we should fix
get_random_int. Chacha20 can generate 64 bits in a few cycles.
> Plus the resulting VA
> space fragmentation.
I think the main cost of fragmentation would be the page tables and
vmas. 2^45 bytes is a lot of bytes.
We could tone it down a bit if we dedicated a range to mmapped data
and tried to pack it reasonably densely. We could even do a fair
amount of merging for data-heavy applications if we gave MAP_PRIVATE |
MAP_ANONYMOUS, PROT_READ | PROT_WRITE mappings a decent chance of
ending up next to each other.
Anyway, this would be a knob. The database people would presumably turn it off.
--Andy
--
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