Skip to content

Commit b648ab4

Browse files
bwhackssuryasaimadhu
authored andcommitted
x86/speculation: Make all RETbleed mitigations 64-bit only
The mitigations for RETBleed are currently ineffective on x86_32 since entry_32.S does not use the required macros. However, for an x86_32 target, the kconfig symbols for them are still enabled by default and /sys/devices/system/cpu/vulnerabilities/retbleed will wrongly report that mitigations are in place. Make all of these symbols depend on X86_64, and only enable RETHUNK by default on X86_64. Fixes: f43b987 ("x86/retbleed: Add fine grained Kconfig knobs") Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent efc72a6 commit b648ab4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ config RETHUNK
24732473
bool "Enable return-thunks"
24742474
depends on RETPOLINE && CC_HAS_RETURN_THUNK
24752475
select OBJTOOL if HAVE_OBJTOOL
2476-
default y
2476+
default y if X86_64
24772477
help
24782478
Compile the kernel with the return-thunks compiler option to guard
24792479
against kernel-to-user data leaks by avoiding return speculation.
@@ -2482,21 +2482,21 @@ config RETHUNK
24822482

24832483
config CPU_UNRET_ENTRY
24842484
bool "Enable UNRET on kernel entry"
2485-
depends on CPU_SUP_AMD && RETHUNK
2485+
depends on CPU_SUP_AMD && RETHUNK && X86_64
24862486
default y
24872487
help
24882488
Compile the kernel with support for the retbleed=unret mitigation.
24892489

24902490
config CPU_IBPB_ENTRY
24912491
bool "Enable IBPB on kernel entry"
2492-
depends on CPU_SUP_AMD
2492+
depends on CPU_SUP_AMD && X86_64
24932493
default y
24942494
help
24952495
Compile the kernel with support for the retbleed=ibpb mitigation.
24962496

24972497
config CPU_IBRS_ENTRY
24982498
bool "Enable IBRS on kernel entry"
2499-
depends on CPU_SUP_INTEL
2499+
depends on CPU_SUP_INTEL && X86_64
25002500
default y
25012501
help
25022502
Compile the kernel with support for the spectre_v2=ibrs mitigation.

0 commit comments

Comments
 (0)