[PATCH] arm: clone: restore stack pointer just after return from syscall

2012-12-11 Thread Filippo ARCIDIACONO
If the syscall returns with an error the stack pointer and r4 register
are not restored because the instruction 'ldmnefd sp!, {r4}' is executed
after branching to '__error' label.
This bug has been spotted out by running './utstest clone 5' from LTP
built with -fstack-protector-all compiler flag as log below:

root@cortex-a9:/usr/tests/ltp/testcases/bin# ./utstest clone 5
stack smashing detected: ./utstest terminated()

Regression introduced by commit e58798e107d652644629a1daaa95d76430808d53

Signed-off-by: Filippo Arcidiacono filippo.arcidiac...@st.com
Signed-off-by: Giuseppe Di Giore giuseppe.di-gi...@st.com
---
 libc/sysdeps/linux/arm/clone.S |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index fdc05b8..e4101ba 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -111,8 +111,8 @@ __clone:
ldr r4, [sp, #12]
DO_CALL (clone)
movsa1, a1
-   blt __error
ldmnefd sp!, {r4}
+   blt __error
IT(t, ne)
 #if defined(__USE_BX__)
bxnelr
-- 
1.7.7.6

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: Perf compilation failure with uclibc due to libintl

2012-12-11 Thread Carmelo AMOROSO
On 10/12/2012 14.41, kkmmkk wrote:
 
 
 
 elfutils needs getext to properly build. It looks like you are using 
 OpenWrt, so I would rather direct you to the openwrt development 
 mailing-list, because this has nothing to do with uClibc per se.
 But I am able to compile with glibc library successfully. You mean do I need
 to enable some configuration for gettext in the openwrt configuration?

you need to build uClibc with UCLIBC_HAS_GETTEXT_AWARENESS enabled.

carmelo
 ___
 uClibc mailing list
 uClibc@uclibc.org
 http://lists.busybox.net/mailman/listinfo/uclibc
 
 

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc


Re: [PATCH] arm: clone: restore stack pointer just after return from syscall

2012-12-11 Thread Carmelo AMOROSO
On 11/12/2012 16.32, Filippo ARCIDIACONO wrote:
 If the syscall returns with an error the stack pointer and r4 register
 are not restored because the instruction 'ldmnefd sp!, {r4}' is executed
 after branching to '__error' label.
 This bug has been spotted out by running './utstest clone 5' from LTP
 built with -fstack-protector-all compiler flag as log below:
 
 root@cortex-a9:/usr/tests/ltp/testcases/bin# ./utstest clone 5
 stack smashing detected: ./utstest terminated()
 
 Regression introduced by commit e58798e107d652644629a1daaa95d76430808d53
 
 Signed-off-by: Filippo Arcidiacono filippo.arcidiac...@st.com
 Signed-off-by: Giuseppe Di Giore giuseppe.di-gi...@st.com
 ---
  libc/sysdeps/linux/arm/clone.S |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
 index fdc05b8..e4101ba 100644
 --- a/libc/sysdeps/linux/arm/clone.S
 +++ b/libc/sysdeps/linux/arm/clone.S
 @@ -111,8 +111,8 @@ __clone:
   ldr r4, [sp, #12]
   DO_CALL (clone)
   movsa1, a1
 - blt __error
   ldmnefd sp!, {r4}
 + blt __error
   IT(t, ne)
  #if defined(__USE_BX__)
   bxnelr
 

sneaky bug. well spotted.

Applied, thanks.
Carmelo

___
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc