diff --git a/security/Kconfig.hardening b/security/Kconfig.hardening index b54eb7177a31..f149bf4f8540 100644 --- a/security/Kconfig.hardening +++ b/security/Kconfig.hardening @@ -37,8 +37,8 @@ config CC_HAS_AUTO_VAR_INIT_ZERO choice prompt "Initialize kernel stack variables at function entry" default GCC_PLUGIN_STRUCTLEAK_BYREF_ALL if COMPILE_TEST && GCC_PLUGINS - default INIT_STACK_ALL_PATTERN if COMPILE_TEST && CC_HAS_AUTO_VAR_INIT_PATTERN - default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_ZERO + default INIT_STACK_ALL_PATTERN if COMPILE_TEST && CC_HAS_AUTO_VAR_INIT_PATTERN && !RISCV + default INIT_STACK_ALL_ZERO if CC_HAS_AUTO_VAR_INIT_ZERO && !RISCV default INIT_STACK_NONE help This option enables initialization of stack variables at