Commit 5f63882e authored by Chunyan Zhang's avatar Chunyan Zhang Committed by Greg Kroah-Hartman

ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch


[ Upstream commit 36b0cb84 ]

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: a5e090ac ("ARM: software-based priviledged-no-access support")
Signed-off-by: default avatarLvqiang Huang <Lvqiang.Huang@spreadtrum.com>
Signed-off-by: default avatarChunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa79bac9
...@@ -85,7 +85,11 @@ ...@@ -85,7 +85,11 @@
.pushsection .text.fixup,"ax" .pushsection .text.fixup,"ax"
.align 4 .align 4
9001: mov r4, #-EFAULT 9001: mov r4, #-EFAULT
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
ldr r5, [sp, #9*4] @ *err_ptr
#else
ldr r5, [sp, #8*4] @ *err_ptr ldr r5, [sp, #8*4] @ *err_ptr
#endif
str r4, [r5] str r4, [r5]
ldmia sp, {r1, r2} @ retrieve dst, len ldmia sp, {r1, r2} @ retrieve dst, len
add r2, r2, r1 add r2, r2, r1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment