lkml.org 
[lkml]   [2018]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1 v2] x86: pkey-mprotect must allow pkey-0
From
Date
On 03/14/2018 10:14 AM, Ram Pai wrote:
> I look at key-0 as 'the key'. It has special status.
> (a) It always exist.

Do you mean "is always allocated"?

> (b) it cannot be freed.

This is the one I'm questioning.

> (c) it is assigned by default.

I agree on this totally. :)

> (d) its permissions cannot be modified.

Why not? You could pretty easily get a thread going that had its stack
covered with another pkey and that was being very careful what it
accesses. It could pretty easily set pkey-0's access or write-disable bits.

> (e) it bypasses key-permission checks when assigned.

I don't think this is necessary. I think the only rule we *need* is:

pkey-0 is allocated implicitly at execve() time. You do not
need to call pkey_alloc() to allocate it.

> An arch need not necessarily map 'the key-0' to its key-0. It could
> internally map it to any of its internal key of its choice, transparent
> to the application.

I don't understand what you are saying here.

\
 
 \ /
  Last update: 2018-03-14 18:52    [W:0.064 / U:6.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site