nospec: Allow getting/setting on non-current task
authorKees Cook <keescook@chromium.org>
Tue, 1 May 2018 22:19:04 +0000 (15:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 May 2018 14:58:01 +0000 (16:58 +0200)
commit4272f528da381673a8e7845c93daa88b8aa4f4e9
tree06df42ad4350a7041883a4e76100e85ca54726e6
parenta078e3e81964c31079627dd32c3ea714d5b1531e
nospec: Allow getting/setting on non-current task

commit 7bbf1373e228840bb0295a2ca26d548ef37f448e upstream

Adjust arch_prctl_get/set_spec_ctrl() to operate on tasks other than
current.

This is needed both for /proc/$pid/status queries and for seccomp (since
thread-syncing can trigger seccomp in non-current threads).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/cpu/bugs.c
include/linux/nospec.h
kernel/sys.c