]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86-64: fix int $0x80 -ENOSYS return
authorRoland McGrath <roland@redhat.com>
Sat, 7 Feb 2009 02:15:18 +0000 (18:15 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Mar 2009 00:32:20 +0000 (17:32 -0700)
commit04de7d2f0799c129f11a6a88869caebe0343fe7b
tree59036716c5b2a74beeef40e0bf1e880a9bb09f8a
parentc8788afb460005ffb5f591ef854eb8630f3eab73
x86-64: fix int $0x80 -ENOSYS return

commit c09249f8d1b84344eca882547afdbffee8c09d14 upstream.

One of my past fixes to this code introduced a different new bug.
When using 32-bit "int $0x80" entry for a bogus syscall number,
the return value is not correctly set to -ENOSYS.  This only happens
when neither syscall-audit nor syscall tracing is enabled (i.e., never
seen if auditd ever started).  Test program:

/* gcc -o int80-badsys -m32 -g int80-badsys.c
   Run on x86-64 kernel.
   Note to reproduce the bug you need auditd never to have started.  */

#include <errno.h>
#include <stdio.h>

int
main (void)
{
  long res;
  asm ("int $0x80" : "=a" (res) : "0" (99999));
  printf ("bad syscall returns %ld\n", res);
  return res != -ENOSYS;
}

The fix makes the int $0x80 path match the sysenter and syscall paths.

Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/ia32/ia32entry.S