Revert "hardening: Disable GCC randstruct for COMPILE_TEST"
authorKees Cook <kees@kernel.org>
Sat, 26 Apr 2025 07:37:55 +0000 (00:37 -0700)
committerKees Cook <kees@kernel.org>
Thu, 8 May 2025 16:42:40 +0000 (09:42 -0700)
This reverts commit f5c68a4e84f9feca3be578199ec648b676db2030.

It is again possible to build "allmodconfig" with the randstruct GCC
plugin, so enable it for COMPILE_TEST to catch future bugs.

Signed-off-by: Kees Cook <kees@kernel.org>
security/Kconfig.hardening

index 3fe9d7b..c17366c 100644 (file)
@@ -344,7 +344,7 @@ config CC_HAS_RANDSTRUCT
 
 choice
        prompt "Randomize layout of sensitive kernel structures"
-       default RANDSTRUCT_FULL if COMPILE_TEST && CC_HAS_RANDSTRUCT
+       default RANDSTRUCT_FULL if COMPILE_TEST && (GCC_PLUGINS || CC_HAS_RANDSTRUCT)
        default RANDSTRUCT_NONE
        help
          If you enable this, the layouts of structures that are entirely