mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
ARM: 9475/1: entry: use byte load for KASAN VMAP stack shadow
Commit44e9a3bb76("ARM: 9430/1: entry: Do a dummy read from VMAP shadow") added a dummy read from the KASAN VMAP stack shadow in __switch_to(). The read uses ldr, but the KASAN shadow address is byte-granular and is not guaranteed to be word aligned. ARMv5 faults unaligned word loads. With CONFIG_KASAN_VMALLOC and CONFIG_VMAP_STACK enabled, ARM926/VersatilePB crashes in __switch_to() with an alignment exception before reaching init. Use ldrb for the dummy shadow access. The code only needs to fault in the shadow mapping if the stack shadow is missing, so a byte load is sufficient and matches the granularity of KASAN shadow memory. Fixes:44e9a3bb76("ARM: 9430/1: entry: Do a dummy read from VMAP shadow") Cc: stable@vger.kernel.org # v6.13+ Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
This commit is contained in:
parent
d59ed80371
commit
77a1f6883d
|
|
@ -567,7 +567,7 @@ ENTRY(__switch_to)
|
|||
@ are using KASAN
|
||||
mov_l r2, KASAN_SHADOW_OFFSET
|
||||
add r2, r2, ip, lsr #KASAN_SHADOW_SCALE_SHIFT
|
||||
ldr r2, [r2]
|
||||
ldrb r2, [r2]
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user