Commit c93c3824 authored by Helge Deller's avatar Helge Deller Committed by openeuler-sync-bot
Browse files

parisc/unaligned: Fix emulate_ldw() breakage

mainline inclusion
from mainline-v5.19-rc5
commit 96b80fcd
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E2GP
CVE: CVE-2024-26706

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=96b80fcd2705fc50ebe1f7f3ce204e861b3099ab



--------------------------------

The commit e8aa7b17 broke the 32-bit load-word unalignment exception
handler because it calculated the wrong amount of bits by which the value
should be shifted. This patch fixes it.

Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Fixes: e8aa7b17 ("parisc/unaligned: Rewrite inline assembly of emulate_ldw()")
Cc: stable@vger.kernel.org   # v5.18
Signed-off-by: default avatarCheng Yu <serein.chengyu@huawei.com>
(cherry picked from commit 44f7674b)
parent 83c4a59c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop)
"	depw	%%r0,31,2,%4\n"
"1:	ldw	0(%%sr1,%4),%0\n"
"2:	ldw	4(%%sr1,%4),%3\n"
"	subi	32,%4,%2\n"
"	subi	32,%2,%2\n"
"	mtctl	%2,11\n"
"	vshd	%0,%3,%0\n"
"3:	\n"