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 <[email protected]>
Reviewed-by: Palmer Dabbelt <[email protected]>
---
arch/riscv/mm/kasan_init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c
index 1b968855d389..57bf4ae09361 100644
--- a/arch/riscv/mm/kasan_init.c
+++ b/arch/riscv/mm/kasan_init.c
@@ -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)
--
2.20.1
On Sat, 13 Mar 2021 00:45:04 PST (-0800), [email protected] wrote:
> 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 <[email protected]>
> Reviewed-by: Palmer Dabbelt <[email protected]>
> ---
> arch/riscv/mm/kasan_init.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c
> index 1b968855d389..57bf4ae09361 100644
> --- a/arch/riscv/mm/kasan_init.c
> +++ b/arch/riscv/mm/kasan_init.c
> @@ -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)
Thanks, this is on fixes.