[PATCH] lkdtm: update KASAN_SANITIZE rule for kstack_erase.o
From: Pengpeng Hou
Date: Thu Dec 03 2026 - 20:58:08 EST
Kbuild now compiles kstack_erase.o for the LKDTM stack erasure tests,
but the per-object KASAN exclusion still names stackleak.o. The
exclusion no longer applies to the object it was written for.
Update the object name; leave instrumentation of other LKDTM objects
alone.
The issue was found by our static-analysis tool and manually reviewed.
Fixes: 57fbad15c2ee ("stackleak: Rename STACKLEAK to KSTACK_ERASE")
Signed-off-by: Pengpeng Hou <hppiscas@xxxxxxx>
---
The original patch was prepared with Gemini. Codex assisted with this
review and revision (Assisted-by: gpt 5).
Built kstack_erase.o with Clang 18 and W=1 on x86-64 with generic KASAN
enabled. The original compile command contained
-fsanitize=kernel-address and the patched one did not. The LKDTM test
itself was not run.
drivers/misc/lkdtm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/lkdtm/Makefile b/drivers/misc/lkdtm/Makefile
index 4e58d16fc01e55b3facce6087f14d1d9f9627016..8e2b9075fdc5d9c7147088c7b199d83598a711ab 100644
--- a/drivers/misc/lkdtm/Makefile
+++ b/drivers/misc/lkdtm/Makefile
@@ -13,7 +13,7 @@ lkdtm-$(CONFIG_LKDTM) += cfi.o
lkdtm-$(CONFIG_LKDTM) += fortify.o
lkdtm-$(CONFIG_PPC_BOOK3S_64) += powerpc.o
-KASAN_SANITIZE_stackleak.o := n
+KASAN_SANITIZE_kstack_erase.o := n
CFLAGS_REMOVE_rodata.o += $(CC_FLAGS_LTO) $(RETHUNK_CFLAGS) $(CC_FLAGS_CFI)
base-commit: d06ce6f1eb5eeffd4ebcfde345dc34a98131d106