Skip to contentSkip to conversation

hardening: Disable GCC randstruct for COMPILE_TEST

PATCH In review Kees Cook 3 participants 3 messages Apr 9, 2025

Subsystems (2)
lore
Share & tools
lore

Kees Cook

author maintainer
#0 lore raw

PATCH 1/1 hardening: Disable GCC randstruct for COMPILE_TEST

There is a GCC crash bug in the randstruct for latest GCC versions that is being tickled by landlock[1]. Temporarily disable GCC randstruct for COMPILE_TEST builds to unbreak CI systems for the coming -rc2. This can be restored once the bug is fixed.

---
Cc: Arnd Bergmann <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Cc: Paul Moore <[email protected]>
Cc: James Morris <[email protected]>
Cc: "Serge E. Hallyn" <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 security/Kconfig.hardening | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
security/Kconfig.hardening +1 -1
index c17366ce8224..3fe9d7b945c4 100644
@@ -344,7 +344,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 COMPILE_TEST && CC_HAS_RANDSTRUCT
 	default RANDSTRUCT_NONE
 	help
 	  If you enable this, the layouts of structures that are entirely
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Kees Cook

There is a GCC crash bug in the randstruct for latest GCC versions that is being tickled by landlock[1]. Temporarily disable GCC randstruct for COMPILE_TEST builds to unbreak CI systems for the coming -rc2. This can be restored once the bug is fixed.

Link:
https://lore.kernel.org/all/[email protected]/

Acked-by on v1 1/1
#2 lore raw
In reply to Kees Cook
Quoted 4 lines · Kees Cook

There is a GCC crash bug in the randstruct for latest GCC versions that is being tickled by landlock[1]. Temporarily disable GCC randstruct for COMPILE_TEST builds to unbreak CI systems for the coming -rc2. This can be restored once the bug is fixed.