1 From 963671276c0ef14458e0a7990107bcd2c075f3cd Mon Sep 17 00:00:00 2001
2 From: Filippo Arcidiacono <filippo.arcidiacono@st.com>
3 Date: Mon, 10 Dec 2012 09:50:52 +0100
4 Subject: [PATCH 6/8] arm: clone: restore stack pointer just after return from
7 If the syscall returns with an error the stack pointer and r4 register
8 are not restored because the instruction 'ldmnefd sp!, {r4}' is executed
9 after branching to '__error' label.
10 This bug has been spotted out by running './utstest clone 5' from LTP
11 built with -fstack-protector-all compiler flag as log below:
13 root@cortex-a9:/usr/tests/ltp/testcases/bin# ./utstest clone 5
14 stack smashing detected: ./utstest terminated()
16 Regression introduced by commit e58798e107d652644629a1daaa95d76430808d53
18 Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
19 Signed-off-by: Giuseppe Di Giore <giuseppe.di-giore@st.com>
20 Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
21 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
23 libc/sysdeps/linux/arm/clone.S | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
26 diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
27 index fdc05b8..e4101ba 100644
28 --- a/libc/sysdeps/linux/arm/clone.S
29 +++ b/libc/sysdeps/linux/arm/clone.S
30 @@ -111,8 +111,8 @@ __clone:
38 #if defined(__USE_BX__)