* [merged mm-stable] ubsan-turn-off-kmsan-inside-of-ubsan-instrumentation.patch removed from -mm tree
@ 2026-03-29 0:40 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-03-29 0:40 UTC (permalink / raw)
To: mm-commits, ryabinin.a.a, peterz, nathan, morbo, kees,
justinstitt, elver, andreyknvl, arnd, akpm
The quilt patch titled
Subject: ubsan: turn off kmsan inside of ubsan instrumentation
has been removed from the -mm tree. Its filename was
ubsan-turn-off-kmsan-inside-of-ubsan-instrumentation.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
Subject: ubsan: turn off kmsan inside of ubsan instrumentation
Date: Fri, 6 Mar 2026 16:05:49 +0100
The structure initialization in the two type mismatch handling functions
causes a call to __msan_memset() to be generated inside of a UACCESS
block, which in turn leads to an objtool warning about possibly leaking
uaccess-enabled state:
lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch+0xda: call to __msan_memset() with UACCESS enabled
lib/ubsan.o: warning: objtool: __ubsan_handle_type_mismatch_v1+0xf4: call to __msan_memset() with UACCESS enabled
Most likely __msan_memset() is safe to be called here and could be added
to the uaccess_safe_builtin[] list of safe functions, but seeing that the
ubsan file itself already has kasan, ubsan and kcsan disabled itself, it
is probably a good idea to also turn off kmsan here, in particular this
also avoids the risk of recursing between ubsan and kcsan checks in other
functions of this file.
I saw this happen while testing randconfig builds with clang-22, but did
not try older versions, or attempt to see which kernel change introduced
the warning.
Link: https://lkml.kernel.org/r/20260306150613.350029-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Marco Elver <elver@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
lib/Makefile | 1 +
1 file changed, 1 insertion(+)
--- a/lib/Makefile~ubsan-turn-off-kmsan-inside-of-ubsan-instrumentation
+++ a/lib/Makefile
@@ -307,6 +307,7 @@ obj-$(CONFIG_UBSAN) += ubsan.o
UBSAN_SANITIZE_ubsan.o := n
KASAN_SANITIZE_ubsan.o := n
KCSAN_SANITIZE_ubsan.o := n
+KMSAN_SANITIZE_ubsan.o := n
CFLAGS_ubsan.o := -fno-stack-protector $(DISABLE_KSTACK_ERASE)
obj-$(CONFIG_SBITMAP) += sbitmap.o
_
Patches currently in -mm which might be from arnd@arndb.de are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-29 0:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-29 0:40 [merged mm-stable] ubsan-turn-off-kmsan-inside-of-ubsan-instrumentation.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.