diff options
author | Nick Hu <nickhu@andestech.com> | 2021-01-13 05:24:10 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-19 20:27:20 +0300 |
commit | 4b0a0655da7fcfcb0fa1f7f14f7606a592545f7e (patch) | |
tree | 66ed098b7ecd19d28fe59160ad20c63a19101aef | |
parent | ab7594f63926c88712c86b7e8a4e506005949909 (diff) | |
download | linux-4b0a0655da7fcfcb0fa1f7f14f7606a592545f7e.tar.xz |
riscv: Fix KASAN memory mapping.
commit c25a053e15778f6b4d6553708673736e27a6c2cf upstream.
Use virtual address instead of physical address when translating
the address to shadow memory by kasan_mem_to_shadow().
Signed-off-by: Nick Hu <nickhu@andestech.com>
Signed-off-by: Nylon Chen <nylon7@andestech.com>
Fixes: b10d6bca8720 ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/riscv/mm/kasan_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c index 12ddd1f6bf70..a8a2ffd9114a 100644 --- a/arch/riscv/mm/kasan_init.c +++ b/arch/riscv/mm/kasan_init.c @@ -93,8 +93,8 @@ void __init kasan_init(void) VMALLOC_END)); for_each_mem_range(i, &_start, &_end) { - void *start = (void *)_start; - void *end = (void *)_end; + void *start = (void *)__va(_start); + void *end = (void *)__va(_end); if (start >= end) break; |