Commit ac66998d authored by Alexander Potapenko's avatar Alexander Potapenko Committed by Andrew Morton

Kconfig.debug: ensure early check for KMSAN in CONFIG_KMSAN_WARN

As pointed out by Masahiro Yamada, Kconfig picks up the first default
entry which has true 'if' condition.  Hence, the previously added check
for KMSAN was never used, because it followed the checks for 64BIT and
!64BIT.

Put KMSAN check before others to ensure it is always applied.

Link: https://lkml.kernel.org/r/20221102110611.1085175-3-glider@google.com
Link: https://github.com/google/kmsan/issues/89
Link: https://lore.kernel.org/linux-mm/20221024212144.2852069-3-glider@google.com/
Fixes: 921757bc ("Kconfig.debug: disable CONFIG_FRAME_WARN for KMSAN by default")
Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Marco Elver <elver@google.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 11385b26
...@@ -395,12 +395,12 @@ endif # DEBUG_INFO ...@@ -395,12 +395,12 @@ endif # DEBUG_INFO
config FRAME_WARN config FRAME_WARN
int "Warn for stack frames larger than" int "Warn for stack frames larger than"
range 0 8192 range 0 8192
default 0 if KMSAN
default 2048 if GCC_PLUGIN_LATENT_ENTROPY default 2048 if GCC_PLUGIN_LATENT_ENTROPY
default 2048 if PARISC default 2048 if PARISC
default 1536 if (!64BIT && XTENSA) default 1536 if (!64BIT && XTENSA)
default 1024 if !64BIT default 1024 if !64BIT
default 2048 if 64BIT default 2048 if 64BIT
default 0 if KMSAN
help help
Tell the compiler to warn at build time for stack frames larger than this. Tell the compiler to warn at build time for stack frames larger than this.
Setting this too low will cause a lot of warnings. Setting this too low will cause a lot of warnings.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment