Skip to content

Commit 71dc301

Browse files
dkaplan2bp3tk0v
authored andcommitted
x86/bugs: Add attack vector controls for SRBDS
Use attack vector controls to determine if SRBDS mitigation is required. Signed-off-by: David Kaplan <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent 54b53dc commit 71dc301

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,13 +870,19 @@ void update_srbds_msr(void)
870870

871871
static void __init srbds_select_mitigation(void)
872872
{
873-
if (!boot_cpu_has_bug(X86_BUG_SRBDS) || cpu_mitigations_off()) {
873+
if (!boot_cpu_has_bug(X86_BUG_SRBDS)) {
874874
srbds_mitigation = SRBDS_MITIGATION_OFF;
875875
return;
876876
}
877877

878-
if (srbds_mitigation == SRBDS_MITIGATION_AUTO)
879-
srbds_mitigation = SRBDS_MITIGATION_FULL;
878+
if (srbds_mitigation == SRBDS_MITIGATION_AUTO) {
879+
if (should_mitigate_vuln(X86_BUG_SRBDS))
880+
srbds_mitigation = SRBDS_MITIGATION_FULL;
881+
else {
882+
srbds_mitigation = SRBDS_MITIGATION_OFF;
883+
return;
884+
}
885+
}
880886

881887
/*
882888
* Check to see if this is one of the MDS_NO systems supporting TSX that

0 commit comments

Comments
 (0)