public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] x86: mm: disable KMSAN instrumentation for physaddr.c
@ 2024-06-21  9:48 Alexander Potapenko
  2024-06-21  9:49 ` [PATCH 2/3] lib/Kconfig.debug: disable LOCK_DEBUGGING_SUPPORT under KMSAN Alexander Potapenko
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Alexander Potapenko @ 2024-06-21  9:48 UTC (permalink / raw)
  To: glider
  Cc: elver, dvyukov, dave.hansen, peterz, akpm, x86, linux-kernel,
	kasan-dev, Kirill A . Shutemov

Enabling CONFIG_DEBUG_VIRTUAL=y together with KMSAN led to infinite
recursion, because kmsan_get_metadata() ended up calling instrumented
__pfn_valid() from arch/x86/mm/physaddr.c.

Prevent it by disabling instrumentation of the whole file.

Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Closes: https://github.com/google/kmsan/issues/95
Signed-off-by: Alexander Potapenko <glider@google.com>
---
 arch/x86/mm/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index 8d3a00e5c528e..d3b27a383127d 100644
--- a/arch/x86/mm/Makefile
+++ b/arch/x86/mm/Makefile
@@ -17,6 +17,7 @@ KCSAN_SANITIZE := n
 # Avoid recursion by not calling KMSAN hooks for CEA code.
 KMSAN_SANITIZE_cpu_entry_area.o := n
 KMSAN_SANITIZE_mem_encrypt_identity.o := n
+KMSAN_SANITIZE_physaddr.o := n
 
 ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_mem_encrypt.o		= -pg
-- 
2.45.2.741.gdbec12cfda-goog


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

end of thread, other threads:[~2024-07-01 14:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21  9:48 [PATCH 1/3] x86: mm: disable KMSAN instrumentation for physaddr.c Alexander Potapenko
2024-06-21  9:49 ` [PATCH 2/3] lib/Kconfig.debug: disable LOCK_DEBUGGING_SUPPORT under KMSAN Alexander Potapenko
2024-06-21 15:02   ` Kirill A . Shutemov
2024-06-21 16:16   ` Dave Hansen
2024-06-21 16:23   ` Dave Hansen
2024-06-25 18:51     ` Boqun Feng
2024-06-25 19:06       ` Paul E. McKenney
2024-06-25 19:37         ` Boqun Feng
2024-06-26  8:35           ` Alexander Potapenko
2024-06-21  9:49 ` [PATCH 3/3] x86/traps: fix an objtool warning in handle_bug() Alexander Potapenko
2024-06-21 15:09   ` Kirill A . Shutemov
2024-06-21 14:57 ` [PATCH 1/3] x86: mm: disable KMSAN instrumentation for physaddr.c Kirill A . Shutemov
2024-06-21 16:40 ` Dave Hansen

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