linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] lockdep: allow instrumenting lockdep.c with KMSAN
@ 2022-11-28  9:45 Alexander Potapenko
  2022-11-28  9:45 ` [PATCH 2/2] kmsan: allow using __msan_instrument_asm_store() inside runtime Alexander Potapenko
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Potapenko @ 2022-11-28  9:45 UTC (permalink / raw)
  To: glider
  Cc: linux-kernel, akpm, peterz, mingo, will, elver, dvyukov,
	linux-mm, kasan-dev, Eric Biggers

Lockdep and KMSAN used to play badly together, causing deadlocks when
KMSAN instrumentation of lockdep.c called lockdep functions recursively.

Looks like this is no more the case, and a kernel can run (yet slower)
with both KMSAN and lockdep enabled.
This patch should fix false positives on wq_head->lock->dep_map, which
KMSAN used to consider uninitialized because of lockdep.c not being
instrumented.

Link: https://lore.kernel.org/lkml/Y3b9AAEKp2Vr3e6O@sol.localdomain/
Reported-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Alexander Potapenko <glider@google.com>
---
 kernel/locking/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/locking/Makefile b/kernel/locking/Makefile
index ea925731fa40f..0db4093d17b8a 100644
--- a/kernel/locking/Makefile
+++ b/kernel/locking/Makefile
@@ -7,7 +7,6 @@ obj-y += mutex.o semaphore.o rwsem.o percpu-rwsem.o
 
 # Avoid recursion lockdep -> sanitizer -> ... -> lockdep.
 KCSAN_SANITIZE_lockdep.o := n
-KMSAN_SANITIZE_lockdep.o := n
 
 ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_lockdep.o = $(CC_FLAGS_FTRACE)
-- 
2.38.1.584.g0f3c55d4c2-goog



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-28  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28  9:45 [PATCH 1/2] lockdep: allow instrumenting lockdep.c with KMSAN Alexander Potapenko
2022-11-28  9:45 ` [PATCH 2/2] kmsan: allow using __msan_instrument_asm_store() inside runtime Alexander Potapenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox