From 5d56072b322a85b9a71e6397719953a32c97e931 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Fri, 5 Jun 2020 15:14:21 -0300 Subject: [PATCH] UBUNTU/SAUCE: x86/speculation/srbds: do not try to turn mitigation off when not supported When SRBDS is mitigated by TSX OFF, update_srbds_msr will still read and write to MSR_IA32_MCU_OPT_CTRL even when that is not supported by the microcode. Checking for X86_FEATURE_SRBDS_CTRL as a CPU feature available makes more sense than checking for SRBDS_MITIGATION_UCODE_NEEDED as the the found "mitigation". CVE-2020-0543 Signed-off-by: Thadeu Lima de Souza Cascardo Acked-by: John Johansen Acked-by: Steve Beattie Signed-off-by: Kleber Sacilotto de Souza --- arch/x86/kernel/cpu/bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 3c3f3e02683a..507117798644 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -425,7 +425,7 @@ void update_srbds_msr(void) if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) return; - if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED) + if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL)) return; rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_ctrl); -- 2.39.5