Commit c2f3edf4 authored by Kees Cook's avatar Kees Cook Committed by Juerg Haefliger

UBUNTU: SAUCE: proc: Provide details on speculation flaw mitigations

CVE-2018-3639 (x86)

As done with seccomp and no_new_privs, also show speculation flaw
mitigation state in /proc/$pid/status.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
[juergh:
 - Context adjustments.
 - Include linux/nospec.h to prevent compilation error.]
Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
parent 33cd29bc
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
#include <linux/delayacct.h> #include <linux/delayacct.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/pid_namespace.h> #include <linux/pid_namespace.h>
#include <linux/nospec.h>
#include <linux/prctl.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/tracehook.h> #include <linux/tracehook.h>
#include <linux/string_helpers.h> #include <linux/string_helpers.h>
...@@ -332,6 +334,28 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) ...@@ -332,6 +334,28 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p)
#ifdef CONFIG_SECCOMP #ifdef CONFIG_SECCOMP
seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode); seq_printf(m, "Seccomp:\t%d\n", p->seccomp.mode);
#endif #endif
seq_printf(m, "\nSpeculation Store Bypass:\t");
switch (arch_prctl_spec_ctrl_get(p, PR_SPEC_STORE_BYPASS)) {
case -EINVAL:
seq_printf(m, "unknown");
break;
case PR_SPEC_NOT_AFFECTED:
seq_printf(m, "not vulnerable");
break;
case PR_SPEC_PRCTL | PR_SPEC_DISABLE:
seq_printf(m, "thread mitigated");
break;
case PR_SPEC_PRCTL | PR_SPEC_ENABLE:
seq_printf(m, "thread vulnerable");
break;
case PR_SPEC_DISABLE:
seq_printf(m, "globally mitigated");
break;
default:
seq_printf(m, "vulnerable");
break;
}
seq_putc(m, '\n');
} }
static inline void task_context_switch_counts(struct seq_file *m, static inline void task_context_switch_counts(struct seq_file *m,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment