[PATCH v3 1/2] riscv: Ensure page table writes are flushed when initializing KASAN vmalloc

Palmer Dabbelt palmer at dabbelt.com
Wed Mar 17 04:56:53 GMT 2021


On Sat, 13 Mar 2021 00:45:04 PST (-0800), alex at ghiti.fr 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 <alex at ghiti.fr>
> Reviewed-by: Palmer Dabbelt <palmerdabbelt at google.com>
> ---
>  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.



More information about the linux-riscv mailing list