Skip to content

Commit a0b02e3

Browse files
leitaobp3tk0v
authored andcommitted
x86/bugs: Add a separate config for SRBDS
Currently, the CONFIG_SPECULATION_MITIGATIONS is halfway populated, where some mitigations have entries in Kconfig, and they could be modified, while others mitigations do not have Kconfig entries, and could not be controlled at build time. Create an entry for the SRBDS CPU mitigation under CONFIG_SPECULATION_MITIGATIONS. This allow users to enable or disable it at compilation time. Signed-off-by: Breno Leitao <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ca01c0d commit a0b02e3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

arch/x86/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,6 +2715,20 @@ config MITIGATION_SPECTRE_V1
27152715
execution that bypasses conditional branch instructions used for
27162716
memory access bounds check.
27172717
See also <file:Documentation/admin-guide/hw-vuln/spectre.rst>
2718+
2719+
config MITIGATION_SRBDS
2720+
bool "Mitigate Special Register Buffer Data Sampling (SRBDS) hardware bug"
2721+
depends on CPU_SUP_INTEL
2722+
default y
2723+
help
2724+
Enable mitigation for Special Register Buffer Data Sampling (SRBDS).
2725+
SRBDS is a hardware vulnerability that allows Microarchitectural Data
2726+
Sampling (MDS) techniques to infer values returned from special
2727+
register accesses. An unprivileged user can extract values returned
2728+
from RDRAND and RDSEED executed on another core or sibling thread
2729+
using MDS techniques.
2730+
See also
2731+
<file:Documentation/admin-guide/hw-vuln/special-register-buffer-data-sampling.rst>
27182732
endif
27192733

27202734
config ARCH_HAS_ADD_PAGES

arch/x86/kernel/cpu/bugs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,8 @@ enum srbds_mitigations {
608608
SRBDS_MITIGATION_HYPERVISOR,
609609
};
610610

611-
static enum srbds_mitigations srbds_mitigation __ro_after_init = SRBDS_MITIGATION_FULL;
611+
static enum srbds_mitigations srbds_mitigation __ro_after_init =
612+
IS_ENABLED(CONFIG_MITIGATION_SRBDS) ? SRBDS_MITIGATION_FULL : SRBDS_MITIGATION_OFF;
612613

613614
static const char * const srbds_strings[] = {
614615
[SRBDS_MITIGATION_OFF] = "Vulnerable",

0 commit comments

Comments
 (0)