OSDN Git Service

ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch
authorChunyan Zhang <zhang.lyra@gmail.com>
Fri, 1 Dec 2017 02:51:04 +0000 (03:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:24:24 +0000 (10:24 +0100)
commitba9443c55f36079cb61fb7bc4913766e9a519585
treee7b7c272f0d518503d00d439ed8ba4d0e03622a0
parentae3471f65a04451f3670cbde6c59e384cca44dc8
ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch

[ Upstream commit 36b0cb84ee858f02c256d26f0cb4229c78e3399e ]

An additional 'ip' will be pushed to the stack, for restoring the
DACR later, if CONFIG_CPU_SW_DOMAIN_PAN defined.

However, the fixup still get the err_ptr by add #8*4 to sp, which
results in the fact that the code area pointed by the LR will be
overwritten, or the kernel will crash if CONFIG_DEBUG_RODATA is enabled.

This patch fixes the stack mismatch.

Fixes: a5e090acbf54 ("ARM: software-based priviledged-no-access support")
Signed-off-by: Lvqiang Huang <Lvqiang.Huang@spreadtrum.com>
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/lib/csumpartialcopyuser.S