Skip to content

Commit c25a053

Browse files
Nick Hupalmer-dabbelt
authored andcommitted
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: Nick Hu <[email protected]> Signed-off-by: Nylon Chen <[email protected]> Fixes: b10d6bc ("arch, drivers: replace for_each_membock() with for_each_mem_range()") Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 0aa2ec8 commit c25a053

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/mm/kasan_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ void __init kasan_init(void)
9393
VMALLOC_END));
9494

9595
for_each_mem_range(i, &_start, &_end) {
96-
void *start = (void *)_start;
97-
void *end = (void *)_end;
96+
void *start = (void *)__va(_start);
97+
void *end = (void *)__va(_end);
9898

9999
if (start >= end)
100100
break;

0 commit comments

Comments
 (0)