The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / uclibc / 0.9.33.2 / 0006-arm-clone-restore-stack-pointer-just-after-return-fr.patch
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
5  syscall
6
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:
12
13 root@cortex-a9:/usr/tests/ltp/testcases/bin# ./utstest clone 5
14 stack smashing detected: ./utstest terminated()
15
16 Regression introduced by commit e58798e107d652644629a1daaa95d76430808d53
17
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>
22 ---
23  libc/sysdeps/linux/arm/clone.S | 2 +-
24  1 file changed, 1 insertion(+), 1 deletion(-)
25
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:
31         ldr     r4, [sp, #12]
32         DO_CALL (clone)
33         movs    a1, a1
34 -       blt     __error
35         ldmnefd sp!, {r4}
36 +       blt     __error
37         IT(t, ne)
38  #if defined(__USE_BX__)
39         bxne    lr
40 -- 
41 1.8.1.2
42