]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ARM: 9475/1: entry: use byte load for KASAN VMAP stack shadow
authorKarl Mehltretter <kmehltretter@gmail.com>
Sun, 24 May 2026 05:52:35 +0000 (06:52 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 11 Jun 2026 13:52:01 +0000 (14:52 +0100)
commit77a1f6883dc6e837bb2cb30b9b02e2f94338e2c6
tree3afa2c4dfe697591dd09fb424fb50d824585505c
parentd59ed803715a71fb9582e139d648ece8d66dc743
ARM: 9475/1: entry: use byte load for KASAN VMAP stack shadow

Commit 44e9a3bb76e5 ("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: 44e9a3bb76e5 ("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>
arch/arm/kernel/entry-armv.S