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

bugs at busybox.net bugs at busybox.net
Thu Mar 6 12:12:20 UTC 2008


The following issue has been SUBMITTED. 
====================================================================== 
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:              03-06-2008 04:12 PST
====================================================================== 
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
--------------------------------------------------------------
====================================================================== 

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          
======================================================================




More information about the uClibc-cvs mailing list