arm64/kasan: don't allocate extra shadow memory
PATCH 66/115 arm64/kasan: don't allocate extra shadow memory
From: Andrey Ryabinin <[email protected]>
Subject: arm64/kasan: don't allocate extra shadow memory
We used to read several bytes of the shadow memory in advance. Therefore additional shadow memory mapped to prevent crash if speculative load would happen near the end of the mapped shadow memory.
Now we don't have such speculative loads, so we no longer need to map additional shadow memory.
Signed-off-by Andrey Ryabinin <[email protected]>
Acked-by Mark Rutland <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Alexander Potapenko <[email protected]>
Cc Dmitry Vyukov <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
arch/arm64/mm/kasan_init.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
arch/arm64/mm/kasan_init.c renamed from arch/arm64/mm/kasan_init.c~arm64-kasan-dont-allocate-extra-shadow-memory +1 -7
@@ -191,14 +191,8 @@ void __init kasan_init(void)if (start >= end)break ; -/* -* end + 1 here is intentional. We check several shadow bytes in -* advance to slightly speed up fastpath. In some rare cases -* we could cross boundary of mapped shadow, so we just map -* some more here. -*/ vmemmap_populate ((unsigned long )kasan_mem_to_shadow (start), - (unsigned long )kasan_mem_to_shadow (end) +1 , + (unsigned long )kasan_mem_to_shadow (end),pfn_to_nid (virt_to_pfn (start))); }
_