From: Konrad Rzeszutek Wilk Date: Fri, 12 Apr 2019 21:50:58 +0000 (-0400) Subject: x86/speculation/mds: Print SMT vulnerable on MSBDS with mitigations off X-Git-Tag: v4.1.12-124.31.3~176 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5a519a1d1ce92cb551f4106168fcffd3c05410e4;p=users%2Fjedix%2Flinux-maple.git x86/speculation/mds: Print SMT vulnerable on MSBDS with mitigations off commit e2c3c94788b08891dcf3dbe608f9880523ecd71b upstream This code is only for CPUs which are affected by MSBDS, but are *not* affected by the other two MDS issues. For such CPUs, enabling the mds_idle_clear mitigation is enough to mitigate SMT. However if user boots with 'mds=off' and still has SMT enabled, we should not report that SMT is mitigated: $cat /sys//devices/system/cpu/vulnerabilities/mds Vulnerable; SMT mitigated But rather: Vulnerable; SMT vulnerable Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Thomas Gleixner Reviewed-by: Tyler Hicks Reviewed-by: Josh Poimboeuf Link: https://lkml.kernel.org/r/20190412215118.294906495@localhost.localdomain (cherry picked from commit 31203de125c7e160bcb42927a5db0bf01de98f6a) Orabug: 29526900 CVE: CVE-2018-12126 CVE: CVE-2018-12130 CVE: CVE-2018-12127 Signed-off-by: Mihai Carabas Reviewed-by: Boris Ostrovsky Conflicts: arch/x86/kernel/cpu/bugs.c bugs.c vs bug_64.c in UEK4 --- diff --git a/arch/x86/kernel/cpu/bugs_64.c b/arch/x86/kernel/cpu/bugs_64.c index 2886aa744ea6..ddb51c6d4103 100644 --- a/arch/x86/kernel/cpu/bugs_64.c +++ b/arch/x86/kernel/cpu/bugs_64.c @@ -1449,7 +1449,8 @@ static ssize_t mds_show_state(char *buf) if (boot_cpu_has(X86_BUG_MSBDS_ONLY)) { return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation], - (cpu_smt_control == CPU_SMT_ENABLED) ? "mitigated" : "disabled"); + (mds_mitigation == MDS_MITIGATION_OFF ? "vulnerable" : + (cpu_smt_control == CPU_SMT_ENABLED ? "mitigated" : "disabled"))); } return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],