Re: [PATCH v2] arm64: compat: Fix decrementing LDM/STM alignment emulation

From: Will Deacon

Date: Thu Aug 27 2026 - 11:23:00 EST


On Thu, 20 Aug 2026 00:27:12 +0200, Karl Mehltretter wrote:
> The compat alignment emulator inherited unsigned long data addresses from
> the 32-bit ARM implementation.
>
> In do_alignment_ldmstm(), nr_regs is an unsigned int holding the transfer
> size. The function uses the same address addition for both transfer
> directions, negating nr_regs first for a decrementing LDM or STM. The
> 32-bit negation wraps before the addition, so the handler adds nearly
> 4 GiB instead of subtracting the transfer size.
> The resulting address lies outside the compat task's address space, so
> decrementing LDM/STM emulation fails, while incrementing forms work.
>
> [...]

Applied to arm64 (for-next/core), thanks!

[1/1] arm64: compat: Fix decrementing LDM/STM alignment emulation
https://git.kernel.org/arm64/c/f5b8b9037df3

Cheers,
--
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev