Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 06 May 2017 06:02:29 +0200
From: David Gens <>
To: Thomas Garnier <>
Cc: Daniel Gruss <>,
        kernel list
        Kernel Hardening
        Michael Schwarz
        Richard Fellner
        "Kirill A. Shutemov"
        Ingo Molnar <>,
Subject: Re: [RFC, PATCH] x86_64: KAISER - do not map
 kernel in user mode

On 2017-05-05 17:47, Thomas Garnier wrote:
> On Fri, May 5, 2017 at 1:23 AM, Daniel Gruss
> <> wrote:
>> On 04.05.2017 17:28, Thomas Garnier wrote:
>>> Please read the documentation on submitting patches [1] and coding 
>>> style [2].
>> I will have a closer look at that.
>>>  - How this approach prevent the hardware attacks you mentioned? You
>>> still have to keep a part of _text in the pagetable and an attacker
>>> could discover it no? (and deduce the kernel base address).
>> These parts are moved to a different section (.user_mapped) which is 
>> at a possibly predictable location - the location of the randomized 
>> parts of the kernel is independent of the location of .user_mapped.
>> The code/data footprint for .user_mapped is quite small, helping to 
>> reduce or eliminate the attack surface...
> If I get it right, it means you can leak the per-cpu address instead
> of the kernel. Correct? That would be a problem because you can
> elevate privilege by overwriting per-cpu variables. Leaking this
> address means also defeating KASLR memory randomization [3] (cf paper
> in the commit).
> In theory you could put the code in the fixmap but you still have the
> per-cpu variables and changing that is hard.
> [3]

(Chiming in here, since we worked on something similar)

Assuming that their patch indeed leaks per-cpu addresses.. it might not 
be required to change it. Since an adversary has to leak the per-cpu 
based on timing information you can work around that by inserting dummy 
into the user mappings, with the goal of creating multiple candidate 
that show an identical measurement. For instance, you can create one 
entry for
every possible KASLR slot.

>>> You also need to make it clear that btb attacks are still possible.
>> By just increasing the KASLR randomization range, btb attacks can be 
>> mitigated (for free).
> Correct, I hope we can do that.
>>>  - What is the perf impact?
>> It will vary for different machines. We have promising results (<1%) 
>> for an i7-6700K with representative benchmarks. However, for older 
>> systems or for workloads with a lot of pressure on some TLB levels, 
>> the performance may be much worse.
> I think including performance data in both cases would be useful.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.