diff mbox series

[2/2] ARM: kasan: Fix compatibility with ARM_MODULE_PLTS

Message ID 20220506060113.14881-2-alexander.sverdlin@nokia.com (mailing list archive)
State New, archived
Headers show
Series [1/2] ARM: kasan: Support CONFIG_KASAN_VMALLOC | expand

Commit Message

Alexander Sverdlin May 6, 2022, 6:01 a.m. UTC
From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

Select KASAN_VMALLOC if KASAN && ARM_MODULE_PLT. Otherwise module load into
vmalloc area crashes the kernel:

Unable to handle kernel paging request at virtual address bce42b5c
CPU: 1 PID: 454 Comm: systemd-udevd
PC is at mmioset+0x7e/0xa0
LR is at kasan_unpoison_shadow+0x1b/0x24
Stack:
(mmioset) from (kasan_unpoison_shadow+0x1b/0x24)
(kasan_unpoison_shadow) from (__asan_register_globals+0x27/0x4c)
(__asan_register_globals) from (do_init_module+0x13d/0x5b8)
(do_init_module) from (load_module+0x6733/0x80f8)
(load_module) from (sys_finit_module+0x119/0x140)
(sys_finit_module) from (ret_fast_syscall+0x1/0x5a)

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
 arch/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f440cf5..d9d60a3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1519,6 +1519,7 @@  config HW_PERF_EVENTS
 config ARM_MODULE_PLTS
 	bool "Use PLTs to allow module memory to spill over into vmalloc area"
 	depends on MODULES
+	select KASAN_VMALLOC if KASAN
 	default y
 	help
 	  Allocate PLTs when loading modules so that jumps and calls whose