diff options
author | Kees Cook <keescook@chromium.org> | 2018-05-01 18:31:45 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-05-03 07:55:51 -0400 |
commit | fae1fa0fc6cca8beee3ab8ed71d54f9a78fa3f64 (patch) | |
tree | 29f33c733c1cbc50f98bc3ecdcd7d89bfbaa8d1f /fs/proc/array.c | |
parent | 7bbf1373e228840bb0295a2ca26d548ef37f448e (diff) |
proc: Provide details on speculation flaw mitigations
As done with seccomp and no_new_privs, also show speculation flaw
mitigation state in /proc/$pid/status.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r-- | fs/proc/array.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index ae2c807fd719..303c155f9b04 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c | |||
@@ -85,6 +85,7 @@ | |||
85 | #include <linux/delayacct.h> | 85 | #include <linux/delayacct.h> |
86 | #include <linux/seq_file.h> | 86 | #include <linux/seq_file.h> |
87 | #include <linux/pid_namespace.h> | 87 | #include <linux/pid_namespace.h> |
88 | #include <linux/prctl.h> | ||
88 | #include <linux/ptrace.h> | 89 | #include <linux/ptrace.h> |
89 | #include <linux/tracehook.h> | 90 | #include <linux/tracehook.h> |
90 | #include <linux/string_helpers.h> | 91 | #include <linux/string_helpers.h> |
@@ -335,6 +336,27 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) | |||
335 | #ifdef CONFIG_SECCOMP | 336 | #ifdef CONFIG_SECCOMP |
336 | seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); | 337 | seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); |
337 | #endif | 338 | #endif |
339 | seq_printf(m, "\nSpeculation Store Bypass:\t"); | ||
340 | switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) { | ||
341 | case -EINVAL: | ||
342 | seq_printf(m, "unknown"); | ||
343 | break; | ||
344 | case PR_SPEC_NOT_AFFECTED: | ||
345 | seq_printf(m, "not vulnerable"); | ||
346 | break; | ||
347 | case PR_SPEC_PRCTL | PR_SPEC_DISABLE: | ||
348 | seq_printf(m, "thread mitigated"); | ||
349 | break; | ||
350 | case PR_SPEC_PRCTL | PR_SPEC_ENABLE: | ||
351 | seq_printf(m, "thread vulnerable"); | ||
352 | break; | ||
353 | case PR_SPEC_DISABLE: | ||
354 | seq_printf(m, "globally mitigated"); | ||
355 | break; | ||
356 | default: | ||
357 | seq_printf(m, "vulnerable"); | ||
358 | break; | ||
359 | } | ||
338 | seq_putc(m, '\n'); | 360 | seq_putc(m, '\n'); |
339 | } | 361 | } |
340 | 362 | ||