From: Borislav Petkov (AMD) Date: Tue, 13 May 2025 11:04:05 +0000 (+0200) Subject: x86/bugs: Fix SRSO reporting on Zen1/2 with SMT disabled X-Git-Tag: v6.16-rc1~195^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=891d3b8be32a69ae94d32e3f1e1ee01359020d49;p=thirdparty%2Fkernel%2Flinux.git x86/bugs: Fix SRSO reporting on Zen1/2 with SMT disabled 1f4bb068b498 ("x86/bugs: Restructure SRSO mitigation") does this: if (boot_cpu_data.x86 < 0x19 && !cpu_smt_possible()) { setup_force_cpu_cap(X86_FEATURE_SRSO_NO); srso_mitigation = SRSO_MITIGATION_NONE; return; } and, in particular, sets srso_mitigation to NONE. This leads to reporting Speculative Return Stack Overflow: Vulnerable on Zen2 machines. There's a far bigger confusion with what SRSO_NO means and how it is used in the code but this will be a matter of future fixes and restructuring to how the SRSO mitigation gets determined. Fix the reporting issue for now. Signed-off-by: Borislav Petkov (AMD) Reviewed-by: David Kaplan Link: https://lore.kernel.org/20250513110405.15872-1-bp@kernel.org --- diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 47c74c4ae2064..dd8b50b4ceaa1 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -2942,7 +2942,9 @@ static void __init srso_update_mitigation(void) boot_cpu_has(X86_FEATURE_IBPB_BRTYPE)) srso_mitigation = SRSO_MITIGATION_IBPB; - if (boot_cpu_has_bug(X86_BUG_SRSO) && !cpu_mitigations_off()) + if (boot_cpu_has_bug(X86_BUG_SRSO) && + !cpu_mitigations_off() && + !boot_cpu_has(X86_FEATURE_SRSO_NO)) pr_info("%s\n", srso_strings[srso_mitigation]); }