[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5783AE8F.3@sr71.net>
Date: Mon, 11 Jul 2016 07:34:55 -0700
From: Dave Hansen <dave@...1.net>
To: Andy Lutomirski <luto@...capital.net>,
Ingo Molnar <mingo@...nel.org>
Cc: linux-arch <linux-arch@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux API <linux-api@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Hugh Dickins <hughd@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH 6/9] x86, pkeys: add pkey set/get syscalls
On 07/10/2016 09:25 PM, Andy Lutomirski wrote:
> 2. When thread A allocates a pkey, how does it lock down thread B?
>
> #2 could be addressed by using fully-locked-down as the initial state
> post-exec() and copying the state on clone(). Dave, are there any
> cases in practice where one thread would allocate a pkey and want
> other threads to immediately have access to the memory with that key?
The only one I can think of is a model where pkeys are used more in a
"denial" mode rather than an "allow" mode.
For instance, perhaps you don't want to modify your app to use pkeys,
except for a small routine where you handle untrusted user data. You
would, in that routine, deny access to a bunch of keys, but otherwise
allow access to all so you didn't have to change any other parts of the app.
Should we instead just recommend to userspace that they lock down access
to keys by default in all threads as a best practice?
Powered by blists - more mailing lists