Skip to content

Commit 163f9fe

Browse files
leitaobp3tk0v
authored andcommitted
x86/bugs: Add a separate config for MMIO Stable Data
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 MMIO Stale data 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 b8da0b3 commit 163f9fe

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

arch/x86/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,6 +2670,18 @@ config MITIGATION_TAA
26702670
which is available in various CPU internal buffers by using
26712671
asynchronous aborts within an Intel TSX transactional region.
26722672
See also <file:Documentation/admin-guide/hw-vuln/tsx_async_abort.rst>
2673+
2674+
config MITIGATION_MMIO_STALE_DATA
2675+
bool "Mitigate MMIO Stale Data hardware bug"
2676+
depends on CPU_SUP_INTEL
2677+
default y
2678+
help
2679+
Enable mitigation for MMIO Stale Data hardware bugs. Processor MMIO
2680+
Stale Data Vulnerabilities are a class of memory-mapped I/O (MMIO)
2681+
vulnerabilities that can expose data. The vulnerabilities require the
2682+
attacker to have access to MMIO.
2683+
See also
2684+
<file:Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst>
26732685
endif
26742686

26752687
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
@@ -393,7 +393,8 @@ enum mmio_mitigations {
393393
};
394394

395395
/* Default mitigation for Processor MMIO Stale Data vulnerabilities */
396-
static enum mmio_mitigations mmio_mitigation __ro_after_init = MMIO_MITIGATION_VERW;
396+
static enum mmio_mitigations mmio_mitigation __ro_after_init =
397+
IS_ENABLED(CONFIG_MITIGATION_MMIO_STALE_DATA) ? MMIO_MITIGATION_VERW : MMIO_MITIGATION_OFF;
397398
static bool mmio_nosmt __ro_after_init = false;
398399

399400
static const char * const mmio_strings[] = {

0 commit comments

Comments
 (0)