Commit 3f9ec80f authored by Andrey Ryabinin's avatar Andrey Ryabinin Committed by Linus Torvalds
Browse files

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: default avatarAndrey Ryabinin <>
Acked-by: Mark Rutland's avatarMark Rutland <>
Cc: Catalin Marinas <>
Cc: Will Deacon <>
Cc: "H. Peter Anvin" <>
Cc: Alexander Potapenko <>
Cc: Dmitry Vyukov <>
Cc: Ingo Molnar <>
Cc: Thomas Gleixner <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 4d461333
......@@ -191,14 +191,8 @@ void __init kasan_init(void)
if (start >= end)
* 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),
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment