]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KMSAN: Remove tautological checks
authorNathan Chancellor <nathan@kernel.org>
Thu, 21 Aug 2025 21:15:49 +0000 (14:15 -0700)
committerNathan Chancellor <nathan@kernel.org>
Thu, 28 Aug 2025 23:58:46 +0000 (16:58 -0700)
Now that the minimum supported version of LLVM for building the kernel
has been bumped to 15.0.0, two KMSAN checks can be cleaned up.

CONFIG_HAVE_KMSAN_COMPILER will always be true when using clang so
remove the cc-option test and use a simple check for CONFIG_CC_IS_CLANG.

CONFIG_HAVE_KMSAN_PARAM_RETVAL will always be true so it can be removed
outright.

Acked-by: Marco Elver <elver@google.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20250821-bump-min-llvm-ver-15-v2-12-635f3294e5f0@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
lib/Kconfig.kmsan

index 0541d7b079cc110dcbafda979dfaf63675ac5eaa..7251b6b59e6931cad6be0e32dc638a7070bb1587 100644 (file)
@@ -3,10 +3,7 @@ config HAVE_ARCH_KMSAN
        bool
 
 config HAVE_KMSAN_COMPILER
-       # Clang versions <14.0.0 also support -fsanitize=kernel-memory, but not
-       # all the features necessary to build the kernel with KMSAN.
-       depends on CC_IS_CLANG && CLANG_VERSION >= 140000
-       def_bool $(cc-option,-fsanitize=kernel-memory -mllvm -msan-disable-checks=1)
+       def_bool CC_IS_CLANG
 
 config KMSAN
        bool "KMSAN: detector of uninitialized values use"
@@ -28,15 +25,9 @@ config KMSAN
 
 if KMSAN
 
-config HAVE_KMSAN_PARAM_RETVAL
-       # -fsanitize-memory-param-retval is supported only by Clang >= 14.
-       depends on HAVE_KMSAN_COMPILER
-       def_bool $(cc-option,-fsanitize=kernel-memory -fsanitize-memory-param-retval)
-
 config KMSAN_CHECK_PARAM_RETVAL
        bool "Check for uninitialized values passed to and returned from functions"
        default y
-       depends on HAVE_KMSAN_PARAM_RETVAL
        help
          If the compiler supports -fsanitize-memory-param-retval, KMSAN will
          eagerly check every function parameter passed by value and every