]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.4.180/x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.4.180 / x86-speculation-mds-print-smt-vulnerable-on-msbds-with-mitigations-off.patch
CommitLineData
1f91e7a4
GKH
1From foo@baz Tue 14 May 2019 08:29:35 PM CEST
2From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
3Date: Fri, 12 Apr 2019 17:50:58 -0400
4Subject: x86/speculation/mds: Print SMT vulnerable on MSBDS with mitigations off
5
6From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
7
8commit e2c3c94788b08891dcf3dbe608f9880523ecd71b upstream.
9
10This code is only for CPUs which are affected by MSBDS, but are *not*
11affected by the other two MDS issues.
12
13For such CPUs, enabling the mds_idle_clear mitigation is enough to
14mitigate SMT.
15
16However if user boots with 'mds=off' and still has SMT enabled, we should
17not report that SMT is mitigated:
18
19$cat /sys//devices/system/cpu/vulnerabilities/mds
20Vulnerable; SMT mitigated
21
22But rather:
23Vulnerable; SMT vulnerable
24
25Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
26Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
27Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
28Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
29Link: https://lkml.kernel.org/r/20190412215118.294906495@localhost.localdomain
30Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
31Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32---
33 arch/x86/kernel/cpu/bugs.c | 3 ++-
34 1 file changed, 2 insertions(+), 1 deletion(-)
35
36--- a/arch/x86/kernel/cpu/bugs.c
37+++ b/arch/x86/kernel/cpu/bugs.c
38@@ -1091,7 +1091,8 @@ static ssize_t mds_show_state(char *buf)
39
40 if (boot_cpu_has(X86_BUG_MSBDS_ONLY)) {
41 return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
42- sched_smt_active() ? "mitigated" : "disabled");
43+ (mds_mitigation == MDS_MITIGATION_OFF ? "vulnerable" :
44+ sched_smt_active() ? "mitigated" : "disabled"));
45 }
46
47 return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],