From: Nathan Chancellor <nathan@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>, Kees Cook <kees@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
llvm@lists.linux.dev, patches@lists.linux.dev,
Marco Elver <elver@google.com>,
Nathan Chancellor <nathan@kernel.org>,
kasan-dev@googlegroups.com
Subject: [PATCH v2 12/12] KMSAN: Remove tautological checks
Date: Thu, 21 Aug 2025 14:15:49 -0700 [thread overview]
Message-ID: <20250821-bump-min-llvm-ver-15-v2-12-635f3294e5f0@kernel.org> (raw)
In-Reply-To: <20250821-bump-min-llvm-ver-15-v2-0-635f3294e5f0@kernel.org>
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>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
Cc: kasan-dev@googlegroups.com
---
lib/Kconfig.kmsan | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/lib/Kconfig.kmsan b/lib/Kconfig.kmsan
index 0541d7b079cc..7251b6b59e69 100644
--- a/lib/Kconfig.kmsan
+++ b/lib/Kconfig.kmsan
@@ -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
--
2.50.1
next prev parent reply other threads:[~2025-08-21 21:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 21:15 [PATCH v2 00/12] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 01/12] kbuild: Bump minimum " Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 02/12] arch/Kconfig: Drop always true condition from RANDOMIZE_KSTACK_OFFSET Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 03/12] ARM: Clean up definition of ARM_HAS_GROUP_RELOCS Nathan Chancellor
2025-08-22 7:05 ` Arnd Bergmann
2025-08-22 20:03 ` Arnd Bergmann
2025-08-26 13:18 ` Ard Biesheuvel
2025-08-21 21:15 ` [PATCH v2 04/12] arm64: Remove tautological LLVM Kconfig conditions Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 05/12] mips: Unconditionally select ARCH_HAS_CURRENT_STACK_POINTER Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 06/12] powerpc: Drop unnecessary initializations in __copy_inst_from_kernel_nofault() Nathan Chancellor
2025-08-22 10:01 ` Christophe Leroy
2025-08-21 21:15 ` [PATCH v2 07/12] riscv: Remove version check for LTO_CLANG selects Nathan Chancellor
2025-08-22 12:31 ` Alexandre Ghiti
2025-08-27 17:31 ` Conor Dooley
2025-08-21 21:15 ` [PATCH v2 08/12] riscv: Unconditionally use linker relaxation Nathan Chancellor
2025-08-22 12:35 ` Alexandre Ghiti
2025-08-21 21:15 ` [PATCH v2 09/12] riscv: Remove ld.lld version checks from many TOOLCHAIN_HAS configs Nathan Chancellor
2025-08-22 12:38 ` Alexandre Ghiti
2025-08-27 17:30 ` Conor Dooley
2025-08-21 21:15 ` [PATCH v2 10/12] lib/Kconfig.debug: Drop CLANG_VERSION check from DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT Nathan Chancellor
2025-08-21 21:15 ` [PATCH v2 11/12] objtool: Drop noinstr hack for KCSAN_WEAK_MEMORY Nathan Chancellor
2025-08-21 21:15 ` Nathan Chancellor [this message]
2025-08-29 22:33 ` [PATCH v2 00/12] Bump minimum supported version of LLVM for building the kernel to 15.0.0 Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250821-bump-min-llvm-ver-15-v2-12-635f3294e5f0@kernel.org \
--to=nathan@kernel.org \
--cc=arnd@arndb.de \
--cc=elver@google.com \
--cc=justinstitt@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=patches@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).