public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Patch "ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch" has been added to the 4.9-stable tree
@ 2018-02-28 15:14 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-02-28 15:14 UTC (permalink / raw)
  To: zhang.lyra, Lvqiang.Huang, alexander.levin, gregkh, rmk+kernel
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

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

to the 4.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm-8731-1-fix-csum_partial_copy_from_user-stack-mismatch.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Wed Feb 28 16:13:29 CET 2018
From: Chunyan Zhang <zhang.lyra@gmail.com>
Date: Fri, 1 Dec 2017 03:51:04 +0100
Subject: ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch

From: Chunyan Zhang <zhang.lyra@gmail.com>


[ 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@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 arch/arm/lib/csumpartialcopyuser.S |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/arm/lib/csumpartialcopyuser.S
+++ b/arch/arm/lib/csumpartialcopyuser.S
@@ -85,7 +85,11 @@
 		.pushsection .text.fixup,"ax"
 		.align	4
 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
+#endif
 		str	r4, [r5]
 		ldmia	sp, {r1, r2}		@ retrieve dst, len
 		add	r2, r2, r1


Patches currently in stable-queue which might be from zhang.lyra@gmail.com are

queue-4.9/arm-8731-1-fix-csum_partial_copy_from_user-stack-mismatch.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-28 15:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-28 15:14 Patch "ARM: 8731/1: Fix csum_partial_copy_from_user() stack mismatch" has been added to the 4.9-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox