lkml.org 
[lkml]   [2018]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH RFC 2/4] x86/arch_prctl: add ARCH_GET_NOPTI and ARCH_SET_NOPTI to enable/disable PTI
On Mon, Jan 8, 2018 at 8:12 AM, Willy Tarreau <w@1wt.eu> wrote:
> This allows to report the current state of the PTI protection and to
> enable or disable it for the current task.

So I really think that this needs to be done up-front to avoid a lot
of complexity. And per mm.

If the process is already threaded (so the mm has multiple users),
it's too late to start playing games with PTI.

In fact, maybe the whole thing needs to be controlled before "exec"
happens, so that we have the knowledge as we build up the mm, rather
than being "runtime" dynamic at all.

But in no case should you even try to handle the multi-threaded case -
just error out for trying to change the PTI setting.

So make the thing per-mm, and then at task switch time as you switch
mms, you set the bit in a percpu variable for testing at kernel entry.

Linus

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