Skip to content

Commit

Permalink
riscv: Ensure page table writes are flushed when initializing KASAN v…
Browse files Browse the repository at this point in the history
…malloc

Make sure that writes to kernel page table during KASAN vmalloc
initialization are made visible by adding a sfence.vma.

Signed-off-by: Alexandre Ghiti <alex@ghiti.fr>
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Fixes: e178d67 ("riscv/kasan: add KASAN_VMALLOC support")
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
  • Loading branch information
Alexandre Ghiti authored and Palmer Dabbelt committed Mar 17, 2021
1 parent ce989f1 commit f3773dd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/riscv/mm/kasan_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ void __init kasan_shallow_populate(void *start, void *end)
}
vaddr += PAGE_SIZE;
}

local_flush_tlb_all();
}

void __init kasan_init(void)
Expand Down

0 comments on commit f3773dd

Please sign in to comment.