lkml.org 
[lkml]   [2015]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 26/26] x86, pkeys: Documentation

* Dave Hansen <dave@sr71.net> wrote:

> > Another question, related to enumeration as well: I'm wondering whether
> > there's any way for the kernel to allocate a bit or two for its own purposes -
> > such as protecting crypto keys? Or is the facility fundamentally intended for
> > user-space use only?
>
> No, that's not possible with the current setup.

Ok, then another question, have you considered the following usecase:

AFAICS pkeys only affect data loads and stores. Instruction fetches are notably
absent from the documentation. Can you clarify that instructions can be fetched
and executed from PTE_READ but pkeys-all-access-disabled pags?

If yes then this could be a significant security feature / usecase for pkeys:
executable sections of shared libraries and binaries could be mapped with pkey
access disabled. If I read the Intel documentation correctly then that should be
possible.

The advantage of doing that is that an existing attack method to circumvent ASLR
(or to scout out an unknown binary) is to use an existing (user-space) information
leak to read the address space of a server process - and to use that to figure out
the actual code present at that address.

The code signature can then be be used to identify the precise layout of the
binary, and/or to create ROP gadgets - to escallate permissions using an otherwise
not exploitable buffer overflow.

I.e. AFAICS pkeys could be used to create true '--x' permissions for executable
(user-space) pages.

But I might be reading it wrong ...

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-09-24 12:01    [W:0.197 / U:1.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site