Skip to content

Commit c648c4b

Browse files
AlexGhitipalmer-dabbelt
authored andcommitted
riscv: Fix config KASAN && DEBUG_VIRTUAL
__virt_to_phys function is called very early in the boot process (ie kasan_early_init) so it should not be instrumented by KASAN otherwise it bugs. Fix this by declaring phys_addr.c as non-kasan instrumentable. Signed-off-by: Alexandre Ghiti <[email protected]> Fixes: 8ad8b72 (riscv: Add KASAN support) Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 5f763b3 commit c648c4b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/riscv/mm/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ obj-$(CONFIG_KASAN) += kasan_init.o
2424
ifdef CONFIG_KASAN
2525
KASAN_SANITIZE_kasan_init.o := n
2626
KASAN_SANITIZE_init.o := n
27+
ifdef CONFIG_DEBUG_VIRTUAL
28+
KASAN_SANITIZE_physaddr.o := n
29+
endif
2730
endif
2831

2932
obj-$(CONFIG_DEBUG_VIRTUAL) += physaddr.o

0 commit comments

Comments
 (0)