Skip to content

Commit 5ff8c11

Browse files
committed
KMSAN: Remove tautological checks
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 <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 573ad42 commit 5ff8c11

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/Kconfig.kmsan

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ config HAVE_ARCH_KMSAN
33
bool
44

55
config HAVE_KMSAN_COMPILER
6-
# Clang versions <14.0.0 also support -fsanitize=kernel-memory, but not
7-
# all the features necessary to build the kernel with KMSAN.
8-
depends on CC_IS_CLANG && CLANG_VERSION >= 140000
9-
def_bool $(cc-option,-fsanitize=kernel-memory -mllvm -msan-disable-checks=1)
6+
def_bool CC_IS_CLANG
107

118
config KMSAN
129
bool "KMSAN: detector of uninitialized values use"
@@ -28,15 +25,9 @@ config KMSAN
2825

2926
if KMSAN
3027

31-
config HAVE_KMSAN_PARAM_RETVAL
32-
# -fsanitize-memory-param-retval is supported only by Clang >= 14.
33-
depends on HAVE_KMSAN_COMPILER
34-
def_bool $(cc-option,-fsanitize=kernel-memory -fsanitize-memory-param-retval)
35-
3628
config KMSAN_CHECK_PARAM_RETVAL
3729
bool "Check for uninitialized values passed to and returned from functions"
3830
default y
39-
depends on HAVE_KMSAN_PARAM_RETVAL
4031
help
4132
If the compiler supports -fsanitize-memory-param-retval, KMSAN will
4233
eagerly check every function parameter passed by value and every

0 commit comments

Comments
 (0)