From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from p5492e61e.dip0.t-ipconnect.de ([84.146.230.30] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fDd5E-0006Rs-Uo for speck@linutronix.de; Tue, 01 May 2018 23:45:13 +0200 Date: Tue, 1 May 2018 23:45:12 +0200 (CEST) From: Thomas Gleixner Subject: Re: [patch V8 15/15] SSB 15 In-Reply-To: <20180430221547.GH8398@outflux.net> Message-ID: References: <20180430150423.180110059@linutronix.de> <20180430151233.029064226@linutronix.de> <20180430221547.GH8398@outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Mon, 30 Apr 2018, speck for Kees Cook wrote: > diff --git a/fs/proc/array.c b/fs/proc/array.c > index ae2c807fd719..4a5cdf199fde 100644 > --- a/fs/proc/array.c > +++ b/fs/proc/array.c > @@ -335,6 +335,25 @@ static inline void task_seccomp(struct seq_file *m, struct task_struct *p) > #ifdef CONFIG_SECCOMP > seq_put_decimal_ull(m, "\nSeccomp:\t", p->seccomp.mode); > #endif > + seq_printf(m, "\nSpeculation, Store Bypass:\t"); > + switch (arch_prctl_get_spec_ctrl(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: > + seq_printf(m, test_tsk_thread_flag(p, TIF_RDS) ? Breaks non x86 as well. Seems to be a common theme... > + "thread mitigated" : "thread vulnerable"); > + break; > + case PR_SPEC_DISABLE: > + seq_printf(m, "globally mitigated"); > + break; > + default: > + seq_printf(m, "vulnerable"); > + break; > + } > seq_putc(m, '\n'); No TIF_RDS required at all. arch_prctl_get_spec_ctrl() gives you all the info already. switch (arch_prctl_get_spec_ctrl(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'); Thanks, tglx