summaryrefslogtreecommitdiff
path: root/include/linux/nospec.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-05-02 01:19:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-22 19:54:03 +0300
commit7d1254a1489c4ecc23a6afdfd1a17bdbb4cd186d (patch)
treecbb6d57327ca925d030fb7cb04ab8649619f3f22 /include/linux/nospec.h
parentd8553911627ab1d9789d08c9902f5e43194f99f7 (diff)
downloadlinux-7d1254a1489c4ecc23a6afdfd1a17bdbb4cd186d.tar.xz
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/nospec.h')
-rw-r--r--include/linux/nospec.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/nospec.h b/include/linux/nospec.h
index 700bb8a4e4ea..a908c954484d 100644
--- a/include/linux/nospec.h
+++ b/include/linux/nospec.h
@@ -7,6 +7,8 @@
#define _LINUX_NOSPEC_H
#include <asm/barrier.h>
+struct task_struct;
+
/**
* array_index_mask_nospec() - generate a ~0 mask when index < size, 0 otherwise
* @index: array element index
@@ -57,7 +59,8 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
})
/* Speculation control prctl */
-int arch_prctl_spec_ctrl_get(unsigned long which);
-int arch_prctl_spec_ctrl_set(unsigned long which, unsigned long ctrl);
+int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which);
+int arch_prctl_spec_ctrl_set(struct task_struct *task, unsigned long which,
+ unsigned long ctrl);
#endif /* _LINUX_NOSPEC_H */