x86/bugs: Fix SRSO reporting on Zen1/2 with SMT disabled
Subsystems (2)
PATCH 1/1 x86/bugs: Fix SRSO reporting on Zen1/2 with SMT disabled
From: "Borislav Petkov (AMD)" <[email protected]>
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.
--- arch/x86/kernel/cpu/bugs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/bugs.c +3 -1
@@ -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]); }
Signature · 1 line
2.43.0
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 55 lines
-----Original Message-----
From: Borislav Petkov <[email protected]>
Sent: Tuesday, May 13, 2025 6:04 AM
To: Kaplan, David <[email protected]>
Cc: X86 ML <[email protected]>; LKML <[email protected]>; Borislav Petkov (AMD) <[email protected]>
Subject: [PATCH] x86/bugs: Fix SRSO reporting on Zen1/2 with SMT disabledCaution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
From: "Borislav Petkov (AMD)" <[email protected]>
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_mitigationto NONE. This leads to reportingSpeculative Return Stack Overflow: Vulnerable
on Zen2 machines.
There's a far bigger confusion with what
SRSO_NOmeans 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) <[email protected]>Cc David Kaplan <[email protected]>--- arch/x86/kernel/cpu/bugs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/x86/kernel/cpu/bugs.c index renamed from arch/x86/kernel/cpu/bugs.c +0
-0
47c74c4ae206..dd8b50b4ceaa100644arch/x86/kernel/cpu/bugs.c +3
-2@@ -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]); } --
Quoted 1 line
2.43.0
LGTM.
--David Kaplan
The following commit has been merged into the x86/core branch of tip:
The following commit has been merged into the x86/core branch of tip:
Commit-ID: 891d3b8be32a69ae94d32e3f1e1ee01359020d49 Gitweb: https://git.kernel.org/tip/891d3b8be32a69ae94d32e3f1e1ee01359020d49 Author: Borislav Petkov (AMD) <[email protected]> AuthorDate: Tue, 13 May 2025 13:04:05 +02:00 Committer: Borislav Petkov (AMD) <[email protected]> CommitterDate: Tue, 13 May 2025 22:31:08 +02:00
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.
--- arch/x86/kernel/cpu/bugs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/bugs.c +3 -1
@@ -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]); }