summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-09-01 23:50:02 +0100
committerKees Cook <kees@kernel.org>2026-09-01 16:01:35 -0700
commit2625480a1bf79c62ffb09aafdf61778e682da492 (patch)
treea5da694565264ddb176a7edb8261311645ea3141 /security
parentcee9395acd8043be0644b25c34bfa86623f2b935 (diff)
downloadlinux-next-2625480a1bf79c62ffb09aafdf61778e682da492.tar.gz
linux-next-2625480a1bf79c62ffb09aafdf61778e682da492.zip
hardening: Default randstruct off with rust for better allmodconfig support
Currently randstruct does not support rust so we have Kconfig dependencies which prevent rust being enabled when randstruct is. Unfortunately this prevents rust being enabled in allmodconfig, our standard coverage build. randstruct gets turned on by default, then the dependency on !RANDSTRUCT causes rust to get disabled. Work around this by disabling randstruct by default if we have a usable rust toolchain and rust support for the architecture, circular dependencies prevent us directly depending on !RUST. This means we might end up with a configuration that disables both rust and randstruct but hopefully it's more likely go give the expected result. Signed-off-by: Mark Brown <broonie@kernel.org> Acked-by: Miguel Ojeda <ojeda@kernel.org> Link: https://patch.msgid.link/20260901-rust-reverse-randstruct-dep-v4-1-3bfa19efe1fa@kernel.org Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'security')
-rw-r--r--security/Kconfig.hardening2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening
index 6923036e1a2f..81c81ad983ad 100644
--- a/security/Kconfig.hardening
+++ b/security/Kconfig.hardening
@@ -278,7 +278,7 @@ config CC_HAS_RANDSTRUCT
choice
prompt "Randomize layout of sensitive kernel structures"
- default RANDSTRUCT_FULL if COMPILE_TEST && (GCC_PLUGINS || CC_HAS_RANDSTRUCT)
+ default RANDSTRUCT_FULL if !(RUST_IS_AVAILABLE && HAVE_RUST) && COMPILE_TEST && (GCC_PLUGINS || CC_HAS_RANDSTRUCT)
default RANDSTRUCT_NONE
help
If you enable this, the layouts of structures that are entirely