[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANpmjNNwp=RRc4Tm7vrKkSzYqdJueeDSOkPRY1sCG-2W-yPVdA@mail.gmail.com>
Date: Tue, 19 Aug 2025 13:02:01 +0200
From: Marco Elver <elver@...gle.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Arnd Bergmann <arnd@...db.de>,
Kees Cook <kees@...nel.org>, Nick Desaulniers <nick.desaulniers+lkml@...il.com>,
Bill Wendling <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, patches@...ts.linux.dev,
Alexander Potapenko <glider@...gle.com>, Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com
Subject: Re: [PATCH 10/10] KMSAN: Remove tautological checks
On Mon, 18 Aug 2025 at 20:58, Nathan Chancellor <nathan@...nel.org> wrote:
>
> 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.
>
> Signed-off-by: Nathan Chancellor <nathan@...nel.org>
Acked-by: Marco Elver <elver@...gle.com>
> ---
> Cc: Alexander Potapenko <glider@...gle.com>
> Cc: Marco Elver <elver@...gle.com>
> Cc: Dmitry Vyukov <dvyukov@...gle.com>
> Cc: kasan-dev@...glegroups.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
>
Powered by blists - more mailing lists