[uClibc 0002454]: Fixing ARM EABI support bug in syscall()

bugs at busybox.net bugs at busybox.net
Thu Apr 10 02:22:51 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=2454 
====================================================================== 
Reported By:                Joe Lin
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   2454
Category:                   Architecture Specific
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             03-06-2008 04:12 PST
Last Modified:              04-09-2008 19:22 PDT
====================================================================== 
Summary:                    Fixing ARM EABI support bug in syscall()
Description: 
When making an EABI syscall() system call, the library does not correctly
pass requesting system number to the Linux kernel.

For example, the ping facility in Busybox will issue a syscall() to get
monotonic time (see monotonic_us() in libbb/time.c). The syscall() in
syscall-eabi.S passes R7 value verbatim. But the kernel (see linux's
vector_swi routine in arch/arm/kernel/entry-common.S) expects R7 a number
without __NR_SYSCALL_BASE.

This bug caused a Segmentation Fault.

Below is the patch.

--------------------------------------------------------------
diff -Naurd uClibc-0.9.29/libc/sysdeps/linux/arm/syscall-eabi.S
uClibc-0.9.29-p1/libc/sysdeps/linux/arm/syscall-eabi.S
--- uClibc-0.9.29/libc/sysdeps/linux/arm/syscall-eabi.S 2006-02-11
12:29:52.000000000 +0800
+++ uClibc-0.9.29-p1/libc/sysdeps/linux/arm/syscall-eabi.S      2008-03-06
19:53:15.000000000 +0800
@@ -29,7 +29,7 @@
 syscall:
        mov     ip, sp
        stmfd   sp!, {r4, r5, r6, r7}
-       mov     r7, r0
+       sub     r7, r0, #SYS_SYSCALL_BASE
        mov     r0, r1
        mov     r1, r2
        mov     r2, r3
--------------------------------------------------------------
====================================================================== 

---------------------------------------------------------------------- 
 khem - 04-09-08 00:07  
---------------------------------------------------------------------- 
is your kernel compiled with AEABI ?
Are you compiling uclibc also with EABI turned on in toolchain ? 

---------------------------------------------------------------------- 
 Joe Lin - 04-09-08 19:22  
---------------------------------------------------------------------- 
Yes, I compiled both kernel and uClibc with EABI turned on. If uClibc was
compiled in OABI, it would go through different path in kernel, which got
no problem. If kernel was not compiled to process EABI executables, EABI
programs would not work. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
03-06-08 04:12  Joe Lin        New Issue                                    
03-06-08 04:12  Joe Lin        Status                   new => assigned     
03-06-08 04:12  Joe Lin        Assigned To               => uClibc          
04-09-08 00:07  khem           Note Added: 0006484                          
04-09-08 19:22  Joe Lin        Note Added: 0006504                          
======================================================================




More information about the uClibc-cvs mailing list