linuxkm/Kbuild: if ENABLED_LINUXKM_PIE, disable KASAN and UBSAN, to avoid external references (__ubsan_handle_out_of_bounds() etc.).

This commit is contained in:
Daniel Pouzzner
2025-07-23 17:30:14 -05:00
parent ca6a12769f
commit 5e57ec5c93

View File

@@ -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"