Commit c25a053e authored by Nick Hu's avatar Nick Hu Committed by Palmer Dabbelt

riscv: Fix KASAN memory mapping.

Use virtual address instead of physical address when translating
the address to shadow memory by kasan_mem_to_shadow().
Signed-off-by: default avatarNick Hu <nickhu@andestech.com>
Signed-off-by: default avatarNylon Chen <nylon7@andestech.com>
Fixes: b10d6bca ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
parent 0aa2ec8a
...@@ -93,8 +93,8 @@ void __init kasan_init(void) ...@@ -93,8 +93,8 @@ void __init kasan_init(void)
VMALLOC_END)); VMALLOC_END));
for_each_mem_range(i, &_start, &_end) { for_each_mem_range(i, &_start, &_end) {
void *start = (void *)_start; void *start = (void *)__va(_start);
void *end = (void *)_end; void *end = (void *)__va(_end);
if (start >= end) if (start >= end)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment