[PATCH] ARM: entry: use byte load for KASAN VMAP stack shadow

Linus Walleij linusw at kernel.org
Sat May 23 15:08:57 PDT 2026


On Fri, May 22, 2026 at 11:15 PM Karl Mehltretter
<kmehltretter at gmail.com> wrote:

> 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 KASAN shadow memory is
> byte-granular and the computed shadow address is not guaranteed to be
> word aligned.
>
> Booting the QEMU versatilepb machine with an ARM926EJ-S CPU and
> CONFIG_KASAN=y, CONFIG_KASAN_VMALLOC=y and CONFIG_VMAP_STACK=y faults
> before init:
>
>   Unhandled fault: alignment exception (0x001) at 0xb91037f6
>   PC is at __switch_to+0x64/0x88
>
> Use ldrb for the dummy shadow access. The code only needs to fault if
> the shadow mapping 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 at vger.kernel.org # v6.13+
> Assisted-by: Codex:gpt-5
> Signed-off-by: Karl Mehltretter <kmehltretter at gmail.com>

Good catch!
Reviewed-by: Linus Walleij <linusw at kernel.org>

Please put this patch into Russell's patch tracker.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list