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>
This commit is contained in:
Alexandre Ghiti 2021-02-08 14:30:15 -05:00 committed by Palmer Dabbelt
parent 7899ed260c
commit 9484e2aef4
No known key found for this signature in database
GPG Key ID: 2E1319F35FBB1889
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}