]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: mm: add missing memcpy in kasan_init
authorQinglin Pan <panqinglin2020@iscas.ac.cn>
Sun, 9 Oct 2022 08:30:50 +0000 (16:30 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 27 Oct 2022 21:55:58 +0000 (14:55 -0700)
commit913796e904dea3ca9ddaae1d841013947695d8db
treea7e71c75e82e41f423ffacb300bfaa1bf2dd9568
parenta76c80d8c40ead154125a311bdae897f8ce20c39
riscv: mm: add missing memcpy in kasan_init

Hi Atish,

It seems that the panic is due to the missing memcpy during kasan_init.
Could you please check whether this patch is helpful?

When doing kasan_populate, the new allocated base_pud/base_p4d should
contain kasan_early_shadow_{pud, p4d}'s content. Add the missing memcpy
to avoid page fault when read/write kasan shadow region.

Tested on:
 - qemu with sv57 and CONFIG_KASAN on.
 - qemu with sv48 and CONFIG_KASAN on.

Signed-off-by: Qinglin Pan <panqinglin2020@iscas.ac.cn>
Tested-by: Atish Patra <atishp@rivosinc.com>
Fixes: a6a05e817427 ("riscv: mm: Support kasan for sv57")
Link: https://lore.kernel.org/r/20221009083050.3814850-1-panqinglin2020@iscas.ac.cn
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/mm/kasan_init.c