]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: 9464/1: fix input-only operand modification in load_unaligned_zeropad()
authorLiyuan Pang <pangliyuan1@huawei.com>
Tue, 9 Dec 2025 02:19:45 +0000 (03:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:39 +0000 (14:03 +0100)
commitfb074e5c4f3eacda00b920a7192f12aa8fdbddad
tree8621d3cc6ab622c83b16c419a21a59db2dfb6801
parent8f9e51cf2a2a43d0cd72d3dc0b5ccea3f639c187
ARM: 9464/1: fix input-only operand modification in load_unaligned_zeropad()

[ Upstream commit edb924a7211c9aa7a4a415e03caee4d875e46b8e ]

In the inline assembly inside load_unaligned_zeropad(), the "addr" is
constrained as input-only operand. The compiler assumes that on exit
from the asm statement these operands contain the same values as they
had before executing the statement, but when kernel page fault happened, the assembly fixup code "bic %2 %2, #0x3" modify the value of "addr", which may lead to an unexpected behavior.

Use a temporary variable "tmp" to handle it, instead of modifying the
input-only operand, just like what arm64's load_unaligned_zeropad()
does.

Fixes: b9a50f74905a ("ARM: 7450/1: dcache: select DCACHE_WORD_ACCESS for little-endian ARMv6+ CPUs")
Co-developed-by: Xie Yuanbin <xieyuanbin1@huawei.com>
Signed-off-by: Xie Yuanbin <xieyuanbin1@huawei.com>
Signed-off-by: Liyuan Pang <pangliyuan1@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/include/asm/word-at-a-time.h