From 5e57ec5c9390b5b4db71fba1f5212a23a9c2b3b8 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 23 Jul 2025 17:30:14 -0500 Subject: [PATCH] linuxkm/Kbuild: if ENABLED_LINUXKM_PIE, disable KASAN and UBSAN, to avoid external references (__ubsan_handle_out_of_bounds() etc.). --- linuxkm/Kbuild | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linuxkm/Kbuild b/linuxkm/Kbuild index ab0399131..93c332fe9 100644 --- a/linuxkm/Kbuild +++ b/linuxkm/Kbuild @@ -105,6 +105,10 @@ ifeq "$(ENABLED_LINUXKM_PIE)" "yes" # "__stack_chk_fail" from the wolfCrypt container. PIE_FLAGS := -fPIE -fno-stack-protector -fno-toplevel-reorder PIE_SUPPORT_FLAGS := -DUSE_WOLFSSL_LINUXKM_PIE_REDIRECT_TABLE + # the kernel sanitizers generate external references to + # __ubsan_handle_out_of_bounds(), __ubsan_handle_shift_out_of_bounds(), etc. + KASAN_SANITIZE := n + UBSAN_SANITIZE := n ifeq "$(KERNEL_ARCH_X86)" "yes" PIE_FLAGS += -mcmodel=small ifeq "$(CONFIG_MITIGATION_RETPOLINE)" "y"