FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-16-2009, 10:11 PM
Aurelien Jarno
 
Default Bug#520034: linux-2.6: inexistant syscalls return wrong errno on mips/mipsel

Package: linux-2.6
Version: 2.6.18.dfsg.1-24
Severity: critical
Tags: patch
Justification: breaks unrelated software

Uninexistant syscalls on mips/mipsel return -ENOSYS errno instead of
ENOSYS. Moreover in some cases it even returns EINVAL instead of ENOSYS.
This make userland software like glibc or coreutils unable to detect
that the syscall does not exist and implement a fallback, which leads
to breakage like 'touch' not working anymore.

This is especially true for lenny running with a kernel from etch, and
will become more true with sid with a kernel from lenny as the glibc
version increases.

This has been fixed in kernel 2.6.28, so kernels from etch, etchnhalf
and lenny are affected. The patch series below applies for all of
them.


commit bda8229bdd087167f463ad5e74299987924f8137
Author: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sat Oct 25 01:17:22 2008 +0900

MIPS: Set positive error number to errno on illegal_syscall

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index 5e75a31..ffa23bd 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -180,7 +180,7 @@ bad_stack:
* The system call does not exist in this kernel
*/
illegal_syscall:
- li v0, -ENOSYS # error
+ li v0, ENOSYS # error
sw v0, PT_R2(sp)
li t0, 1 # set error flag
sw t0, PT_R7(sp)
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index 3d58204..a9e1716 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -117,7 +117,7 @@ syscall_trace_entry:

illegal_syscall:
/* This also isn't a 64-bit syscall, throw an error. */
- li v0, -ENOSYS # error
+ li v0, ENOSYS # error
sd v0, PT_R2(sp)
li t0, 1 # set error flag
sd t0, PT_R7(sp)
commit fb498e2570eedc6c9c3d165e370624dfc3aed97b
Author: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Sat Oct 25 01:17:23 2008 +0900

MIPS: Set ENOSYS to errno on illegal system call number for syscall(2)

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index ffa23bd..759f680 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -293,7 +293,7 @@ bad_alignment:
jr t2
/* Unreached */

-einval: li v0, -EINVAL
+einval: li v0, -ENOSYS
jr ra
END(sys_syscall)

commit c6cb4df96fa22d1174d6fb6dfc2c7501d7afaeea
Author: David Daney <ddaney@caviumnetworks.com>
Date: Fri Oct 31 11:23:09 2008 -0700

MIPS: Return ENOSYS from sys32_syscall on 64bit kernels like elsewhere.

When the o32 errno was changed to ENOSYS, we forgot to update the code
for 64bit kernels.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Acked-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 3d55e3b..fefef4a 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -196,7 +196,7 @@ LEAF(sys32_syscall)
jr t2
/* Unreached */

-einval: li v0, -EINVAL
+einval: li v0, -ENOSYS
jr ra
END(sys32_syscall)


-- System Information:
Debian Release: 5.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: mipsel (mips64)

Kernel: Linux 2.6.26-1-5kc-malta
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-17-2009, 06:26 AM
Martin Michlmayr
 
Default Bug#520034: linux-2.6: inexistant syscalls return wrong errno on mips/mipsel

* Aurelien Jarno <aurel32@mipsel.aurel32.net> [2009-03-17 00:11]:
> Package: linux-2.6
> Version: 2.6.18.dfsg.1-24

Would you like to have SVN access to the kernel repo, so you can
commit such changes yourself?

--
Martin Michlmayr
http://www.cyrius.com/



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-17-2009, 07:27 AM
Aurelien Jarno
 
Default Bug#520034: linux-2.6: inexistant syscalls return wrong errno on mips/mipsel

Martin Michlmayr a écrit :
> * Aurelien Jarno <aurel32@mipsel.aurel32.net> [2009-03-17 00:11]:
>> Package: linux-2.6
>> Version: 2.6.18.dfsg.1-24
>
> Would you like to have SVN access to the kernel repo, so you can
> commit such changes yourself?

I actually have commit access, I'll commit the patches. But given it
concerns stable kernels, I prefer to see a bug open, and look for
comments. Also debian-admin needed a bug number to add in their tracker.

--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-17-2009, 09:07 AM
Martin Michlmayr
 
Default Bug#520034: linux-2.6: inexistant syscalls return wrong errno on mips/mipsel

* Aurelien Jarno <aurelien@aurel32.net> [2009-03-17 09:27]:
> > Would you like to have SVN access to the kernel repo, so you can
> > commit such changes yourself?
>
> I actually have commit access, I'll commit the patches. But given it
> concerns stable kernels, I prefer to see a bug open, and look for
> comments. Also debian-admin needed a bug number to add in their tracker.

I know... I was just checking whether you were going to commit them.

--
Martin Michlmayr
http://www.cyrius.com/



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 03-17-2009, 10:14 AM
Aurelien Jarno
 
Default Bug#520034: linux-2.6: inexistant syscalls return wrong errno on mips/mipsel

clone 520034 -1
reassign -1 linux-2.6.24
thanks

On Tue, Mar 17, 2009 at 12:11:45AM +0100, Aurelien Jarno wrote:
> Package: linux-2.6
> Version: 2.6.18.dfsg.1-24
> Severity: critical
> Tags: patch
> Justification: breaks unrelated software
>
> Uninexistant syscalls on mips/mipsel return -ENOSYS errno instead of
> ENOSYS. Moreover in some cases it even returns EINVAL instead of ENOSYS.
> This make userland software like glibc or coreutils unable to detect
> that the syscall does not exist and implement a fallback, which leads
> to breakage like 'touch' not working anymore.
>
> This is especially true for lenny running with a kernel from etch, and
> will become more true with sid with a kernel from lenny as the glibc
> version increases.
>
> This has been fixed in kernel 2.6.28, so kernels from etch, etchnhalf
> and lenny are affected. The patch series below applies for all of
> them.

etchnhalf kernel is a different source package. Cloning the bug.

--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net



--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 03:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org