Skip to content

Commit 22cac9c

Browse files
pa1guptasuryasaimadhu
authored andcommitted
x86/speculation/srbds: Update SRBDS mitigation selection
Currently, Linux disables SRBDS mitigation on CPUs not affected by MDS and have the TSX feature disabled. On such CPUs, secrets cannot be extracted from CPU fill buffers using MDS or TAA. Without SRBDS mitigation, Processor MMIO Stale Data vulnerabilities can be used to extract RDRAND, RDSEED, and EGETKEY data. Do not disable SRBDS mitigation by default when CPU is also affected by Processor MMIO Stale Data vulnerabilities. Signed-off-by: Pawan Gupta <[email protected]> Signed-off-by: Borislav Petkov <[email protected]>
1 parent 8d50cdf commit 22cac9c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/x86/kernel/cpu/bugs.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,13 @@ static void __init srbds_select_mitigation(void)
595595
return;
596596

597597
/*
598-
* Check to see if this is one of the MDS_NO systems supporting
599-
* TSX that are only exposed to SRBDS when TSX is enabled.
598+
* Check to see if this is one of the MDS_NO systems supporting TSX that
599+
* are only exposed to SRBDS when TSX is enabled or when CPU is affected
600+
* by Processor MMIO Stale Data vulnerability.
600601
*/
601602
ia32_cap = x86_read_arch_cap_msr();
602-
if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM))
603+
if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM) &&
604+
!boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA))
603605
srbds_mitigation = SRBDS_MITIGATION_TSX_OFF;
604606
else if (boot_cpu_has(X86_FEATURE_HYPERVISOR))
605607
srbds_mitigation = SRBDS_MITIGATION_HYPERVISOR;

0 commit comments

Comments
 (0)