summaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorAlexandre Ghiti <alex@ghiti.fr>2021-02-08 14:30:15 -0500
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-02-22 18:44:56 -0800
commit9484e2aef45bbc27cd23519917f27031e2857a6f (patch)
tree3da25f791e9609fff54d41506a2534ba6d1ac26a /arch/riscv
parent7899ed260c348fe8813150c12c7a59fa0e3e9121 (diff)
downloadlinux-stable-9484e2aef45bbc27cd23519917f27031e2857a6f.tar.gz
linux-stable-9484e2aef45bbc27cd23519917f27031e2857a6f.tar.bz2
linux-stable-9484e2aef45bbc27cd23519917f27031e2857a6f.zip
riscv: Use KASAN_SHADOW_INIT define for kasan memory initialization
Instead of hardcoding memory initialization to 0, use KASAN_SHADOW_INIT. Signed-off-by: Alexandre Ghiti <alex@ghiti.fr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/mm/kasan_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c
index 4b9149f963d3..8f23799fcbe6 100644
--- a/arch/riscv/mm/kasan_init.c
+++ b/arch/riscv/mm/kasan_init.c
@@ -93,7 +93,7 @@ static void __init populate(void *start, void *end)
__pgprot(_PAGE_TABLE)));
local_flush_tlb_all();
- memset(start, 0, end - start);
+ memset(start, KASAN_SHADOW_INIT, end - start);
}
void __init kasan_shallow_populate(void *start, void *end)
@@ -163,6 +163,6 @@ void __init kasan_init(void)
__pgprot(_PAGE_PRESENT | _PAGE_READ |
_PAGE_ACCESSED)));
- memset(kasan_early_shadow_page, 0, PAGE_SIZE);
+ memset(kasan_early_shadow_page, KASAN_SHADOW_INIT, PAGE_SIZE);
init_task.kasan_depth = 0;
}