Skip to content

Commit 894e288

Browse files
leitaobp3tk0v
authored andcommitted
x86/bugs: Add a separate config for RETBLEED
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 RETBLEED 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 3a4ee4f commit 894e288

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

arch/x86/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,6 +2692,19 @@ config MITIGATION_L1TF
26922692
hardware vulnerability which allows unprivileged speculative access to data
26932693
available in the Level 1 Data Cache.
26942694
See <file:Documentation/admin-guide/hw-vuln/l1tf.rst
2695+
2696+
config MITIGATION_RETBLEED
2697+
bool "Mitigate RETBleed hardware bug"
2698+
depends on (CPU_SUP_INTEL && MITIGATION_SPECTRE_V2) || MITIGATION_UNRET_ENTRY || MITIGATION_IBPB_ENTRY
2699+
default y
2700+
help
2701+
Enable mitigation for RETBleed (Arbitrary Speculative Code Execution
2702+
with Return Instructions) vulnerability. RETBleed is a speculative
2703+
execution attack which takes advantage of microarchitectural behavior
2704+
in many modern microprocessors, similar to Spectre v2. An
2705+
unprivileged attacker can use these flaws to bypass conventional
2706+
memory security restrictions to gain read access to privileged memory
2707+
that would otherwise be inaccessible.
26952708
endif
26962709

26972710
config ARCH_HAS_ADD_PAGES

arch/x86/kernel/cpu/bugs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ static const char * const retbleed_strings[] = {
989989
static enum retbleed_mitigation retbleed_mitigation __ro_after_init =
990990
RETBLEED_MITIGATION_NONE;
991991
static enum retbleed_mitigation_cmd retbleed_cmd __ro_after_init =
992-
RETBLEED_CMD_AUTO;
992+
IS_ENABLED(CONFIG_MITIGATION_RETBLEED) ? RETBLEED_CMD_AUTO : RETBLEED_CMD_OFF;
993993

994994
static int __ro_after_init retbleed_nosmt = false;
995995

0 commit comments

Comments
 (0)