From: Josh Poimboeuf Date: Tue, 2 Apr 2019 15:00:51 +0000 (-0500) Subject: x86/speculation/mds: Add SMT warning message X-Git-Tag: v4.1.12-124.31.3~182 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=21d2768921b7b23f284852a403ad920824e0f174;p=users%2Fjedix%2Flinux-maple.git x86/speculation/mds: Add SMT warning message commit 39226ef02bfb43248b7db12a4fdccb39d95318e3 upstream MDS is vulnerable with SMT. Make that clear with a one-time printk whenever SMT first gets enabled. Signed-off-by: Josh Poimboeuf Signed-off-by: Thomas Gleixner Reviewed-by: Tyler Hicks Acked-by: Jiri Kosina (cherry picked from commit 2dad2dcf7f7eab0e6d10d560e22fddd0a08b37b3) 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 bugs_64.c: we do not have arch_smt_update. Squash the check in mds_select_mitigation. --- diff --git a/arch/x86/kernel/cpu/bugs_64.c b/arch/x86/kernel/cpu/bugs_64.c index 41b485b160b2..a2a2021ea511 100644 --- a/arch/x86/kernel/cpu/bugs_64.c +++ b/arch/x86/kernel/cpu/bugs_64.c @@ -1327,6 +1327,9 @@ static const char * const mds_strings[] = { [MDS_MITIGATION_VMWERV] = "Vulnerable: Clear CPU buffers attempted, no microcode", }; +#undef pr_fmt +#define pr_fmt(fmt) "MDS: " fmt + static void update_mds_branch_idle(void) { /* @@ -1344,6 +1347,8 @@ static void update_mds_branch_idle(void) static_branch_disable(&mds_idle_clear); } +#define MDS_MSG_SMT "MDS CPU bug present and SMT on, data leak possible. See https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/mds.html for more details.\n" + static void mds_select_mitigation(void) { char arg[12]; @@ -1374,12 +1379,17 @@ static void mds_select_mitigation(void) if (mds_nosmt && !boot_cpu_has(X86_BUG_MSBDS_ONLY)) cpu_smt_disable(false); + if (cpu_smt_control == CPU_SMT_ENABLED && + !boot_cpu_has(X86_BUG_MSBDS_ONLY)) + pr_warn_once(MDS_MSG_SMT); + update_mds_branch_idle(); } pr_info("%s\n", mds_strings[mds_mitigation]); } #undef pr_fmt +#define pr_fmt(fmt) fmt #ifdef CONFIG_SYSFS