Skip to content

Commit 75ca444

Browse files
committed
x86/bugs: Add attack vector controls for SSB
JIRA: https://issues.redhat.com/browse/RHEL-119227 commit 8b3641d Author: David Kaplan <david.kaplan@amd.com> Date: Tue, 19 Aug 2025 14:21:59 -0500 x86/bugs: Add attack vector controls for SSB Attack vector controls for SSB were missed in the initial attack vector series. The default mitigation for SSB requires user-space opt-in so it is only relevant for user->user attacks. Check with attack vector controls when the command is auto - i.e., no explicit user selection has been done. Fixes: 2d31d28 ("x86/bugs: Define attack vectors relevant for each bug") Signed-off-by: David Kaplan <david.kaplan@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/20250819192200.2003074-5-david.kaplan@amd.com Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 01fecdc commit 75ca444

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Documentation/admin-guide/hw-vuln/attack_vector_controls.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Spectre_v2 X X
215215
Spectre_v2_user X X * (Note 1)
216216
SRBDS X X X X
217217
SRSO X X X X
218-
SSB (Note 4)
218+
SSB X
219219
TAA X X X X * (Note 2)
220220
TSA X X X X
221221
=============== ============== ============ ============= ============== ============ ========
@@ -229,9 +229,6 @@ Notes:
229229
3 -- Disables SMT if cross-thread mitigations are fully enabled, the CPU is
230230
vulnerable, and STIBP is not supported
231231

232-
4 -- Speculative store bypass is always enabled by default (no kernel
233-
mitigation applied) unless overridden with spec_store_bypass_disable option
234-
235232
When an attack-vector is disabled, all mitigations for the vulnerabilities
236233
listed in the above table are disabled, unless mitigation is required for a
237234
different enabled attack-vector or a mitigation is explicitly selected via a

arch/x86/kernel/cpu/bugs.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,10 @@ static bool __init should_mitigate_vuln(unsigned int bug)
430430
cpu_attack_vector_mitigated(CPU_MITIGATE_USER_USER) ||
431431
cpu_attack_vector_mitigated(CPU_MITIGATE_GUEST_GUEST) ||
432432
(smt_mitigations != SMT_MITIGATIONS_OFF);
433+
434+
case X86_BUG_SPEC_STORE_BYPASS:
435+
return cpu_attack_vector_mitigated(CPU_MITIGATE_USER_USER);
436+
433437
default:
434438
WARN(1, "Unknown bug %x\n", bug);
435439
return false;
@@ -2642,6 +2646,11 @@ static void __init ssb_select_mitigation(void)
26422646
ssb_mode = SPEC_STORE_BYPASS_DISABLE;
26432647
break;
26442648
case SPEC_STORE_BYPASS_CMD_AUTO:
2649+
if (should_mitigate_vuln(X86_BUG_SPEC_STORE_BYPASS))
2650+
ssb_mode = SPEC_STORE_BYPASS_PRCTL;
2651+
else
2652+
ssb_mode = SPEC_STORE_BYPASS_NONE;
2653+
break;
26452654
case SPEC_STORE_BYPASS_CMD_PRCTL:
26462655
ssb_mode = SPEC_STORE_BYPASS_PRCTL;
26472656
break;

0 commit comments

Comments
 (0)