linux/arch/riscv/lib
Nick Hu 8ad8b72721
riscv: Add KASAN support
This patch ports the feature Kernel Address SANitizer (KASAN).

Note: The start address of shadow memory is at the beginning of kernel
space, which is 2^64 - (2^39 / 2) in SV39. The size of the kernel space is
2^38 bytes so the size of shadow memory should be 2^38 / 8. Thus, the
shadow memory would not overlap with the fixmap area.

There are currently two limitations in this port,

1. RV64 only: KASAN need large address space for extra shadow memory
region.

2. KASAN can't debug the modules since the modules are allocated in VMALLOC
area. We mapped the shadow memory, which corresponding to VMALLOC area, to
the kasan_early_shadow_page because we don't have enough physical space for
all the shadow memory corresponding to VMALLOC area.

Signed-off-by: Nick Hu <nickhu@andestech.com>
Reported-by: Greentime Hu <green.hu@gmail.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
2020-01-22 13:09:58 -08:00
..
delay.c riscv: delay: use do_div() instead of __udivdi3() 2019-08-08 16:05:38 -07:00
Makefile riscv: add nommu support 2019-11-17 15:17:39 -08:00
memcpy.S riscv: Add KASAN support 2020-01-22 13:09:58 -08:00
memset.S riscv: Add KASAN support 2020-01-22 13:09:58 -08:00
tishift.S riscv: Less inefficient gcc tishift helpers (and export their symbols) 2020-01-18 19:13:41 -08:00
uaccess.S riscv: fix compile failure with EXPORT_SYMBOL() & !MMU 2019-12-27 21:44:36 -08:00