提交 ddcd6b17 编写于 作者: P Paolo 'Blaisorblade' Giarrusso 提交者: Linus Torvalds

[PATCH] uml: quick fix syscall table for x86_64

Fix the moved syscall table for the x86_64 SUBARCH:

- redirect __NR_chown and such to versions aware of 32-bit UIDs,

- avoid the useless hack for sys_nfsservctl,

- use sys_sendfile64 in the table rather than sys_sendfile.

- __NR_uselib is sys_ni_syscall on x86_64 (which does not support A.OUT).

- __NR_getrlimit is sys_getrlimit, not sys_old_getrlimit
Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 5e7b83ff
...@@ -14,12 +14,6 @@ ...@@ -14,12 +14,6 @@
#include "sysdep/syscalls.h" #include "sysdep/syscalls.h"
#include "kern_util.h" #include "kern_util.h"
#ifdef CONFIG_NFSD
#define NFSSERVCTL sys_nfsservctl
#else
#define NFSSERVCTL sys_ni_syscall
#endif
#define LAST_GENERIC_SYSCALL __NR_keyctl #define LAST_GENERIC_SYSCALL __NR_keyctl
#if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL #if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
...@@ -52,6 +46,7 @@ extern syscall_handler_t sys_get_mempolicy; ...@@ -52,6 +46,7 @@ extern syscall_handler_t sys_get_mempolicy;
extern syscall_handler_t sys_set_mempolicy; extern syscall_handler_t sys_set_mempolicy;
extern syscall_handler_t sys_sys_setaltroot; extern syscall_handler_t sys_sys_setaltroot;
/* On X86-64 all syscalls are aware of 32-bit [ug]ids, so I had to fix this!*/
syscall_handler_t *sys_call_table[] = { syscall_handler_t *sys_call_table[] = {
[ __NR_restart_syscall ] = (syscall_handler_t *) sys_restart_syscall, [ __NR_restart_syscall ] = (syscall_handler_t *) sys_restart_syscall,
[ __NR_exit ] = (syscall_handler_t *) sys_exit, [ __NR_exit ] = (syscall_handler_t *) sys_exit,
...@@ -72,12 +67,12 @@ syscall_handler_t *sys_call_table[] = { ...@@ -72,12 +67,12 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_time ] = um_time, [ __NR_time ] = um_time,
[ __NR_mknod ] = (syscall_handler_t *) sys_mknod, [ __NR_mknod ] = (syscall_handler_t *) sys_mknod,
[ __NR_chmod ] = (syscall_handler_t *) sys_chmod, [ __NR_chmod ] = (syscall_handler_t *) sys_chmod,
[ __NR_lchown ] = (syscall_handler_t *) sys_lchown16, [ __NR_lchown ] = (syscall_handler_t *) sys_lchown,
[ __NR_lseek ] = (syscall_handler_t *) sys_lseek, [ __NR_lseek ] = (syscall_handler_t *) sys_lseek,
[ __NR_getpid ] = (syscall_handler_t *) sys_getpid, [ __NR_getpid ] = (syscall_handler_t *) sys_getpid,
[ __NR_mount ] = (syscall_handler_t *) sys_mount, [ __NR_mount ] = (syscall_handler_t *) sys_mount,
[ __NR_setuid ] = (syscall_handler_t *) sys_setuid16, [ __NR_setuid ] = (syscall_handler_t *) sys_setuid,
[ __NR_getuid ] = (syscall_handler_t *) sys_getuid16, [ __NR_getuid ] = (syscall_handler_t *) sys_getuid,
[ __NR_ptrace ] = (syscall_handler_t *) sys_ptrace, [ __NR_ptrace ] = (syscall_handler_t *) sys_ptrace,
[ __NR_alarm ] = (syscall_handler_t *) sys_alarm, [ __NR_alarm ] = (syscall_handler_t *) sys_alarm,
[ __NR_pause ] = (syscall_handler_t *) sys_pause, [ __NR_pause ] = (syscall_handler_t *) sys_pause,
...@@ -94,10 +89,10 @@ syscall_handler_t *sys_call_table[] = { ...@@ -94,10 +89,10 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_pipe ] = (syscall_handler_t *) sys_pipe, [ __NR_pipe ] = (syscall_handler_t *) sys_pipe,
[ __NR_times ] = (syscall_handler_t *) sys_times, [ __NR_times ] = (syscall_handler_t *) sys_times,
[ __NR_brk ] = (syscall_handler_t *) sys_brk, [ __NR_brk ] = (syscall_handler_t *) sys_brk,
[ __NR_setgid ] = (syscall_handler_t *) sys_setgid16, [ __NR_setgid ] = (syscall_handler_t *) sys_setgid,
[ __NR_getgid ] = (syscall_handler_t *) sys_getgid16, [ __NR_getgid ] = (syscall_handler_t *) sys_getgid,
[ __NR_geteuid ] = (syscall_handler_t *) sys_geteuid16, [ __NR_geteuid ] = (syscall_handler_t *) sys_geteuid,
[ __NR_getegid ] = (syscall_handler_t *) sys_getegid16, [ __NR_getegid ] = (syscall_handler_t *) sys_getegid,
[ __NR_acct ] = (syscall_handler_t *) sys_acct, [ __NR_acct ] = (syscall_handler_t *) sys_acct,
[ __NR_umount2 ] = (syscall_handler_t *) sys_umount, [ __NR_umount2 ] = (syscall_handler_t *) sys_umount,
[ __NR_ioctl ] = (syscall_handler_t *) sys_ioctl, [ __NR_ioctl ] = (syscall_handler_t *) sys_ioctl,
...@@ -110,26 +105,26 @@ syscall_handler_t *sys_call_table[] = { ...@@ -110,26 +105,26 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_getppid ] = (syscall_handler_t *) sys_getppid, [ __NR_getppid ] = (syscall_handler_t *) sys_getppid,
[ __NR_getpgrp ] = (syscall_handler_t *) sys_getpgrp, [ __NR_getpgrp ] = (syscall_handler_t *) sys_getpgrp,
[ __NR_setsid ] = (syscall_handler_t *) sys_setsid, [ __NR_setsid ] = (syscall_handler_t *) sys_setsid,
[ __NR_setreuid ] = (syscall_handler_t *) sys_setreuid16, [ __NR_setreuid ] = (syscall_handler_t *) sys_setreuid,
[ __NR_setregid ] = (syscall_handler_t *) sys_setregid16, [ __NR_setregid ] = (syscall_handler_t *) sys_setregid,
[ __NR_sethostname ] = (syscall_handler_t *) sys_sethostname, [ __NR_sethostname ] = (syscall_handler_t *) sys_sethostname,
[ __NR_setrlimit ] = (syscall_handler_t *) sys_setrlimit, [ __NR_setrlimit ] = (syscall_handler_t *) sys_setrlimit,
[ __NR_getrlimit ] = (syscall_handler_t *) sys_old_getrlimit, [ __NR_getrlimit ] = (syscall_handler_t *) sys_getrlimit,
[ __NR_getrusage ] = (syscall_handler_t *) sys_getrusage, [ __NR_getrusage ] = (syscall_handler_t *) sys_getrusage,
[ __NR_gettimeofday ] = (syscall_handler_t *) sys_gettimeofday, [ __NR_gettimeofday ] = (syscall_handler_t *) sys_gettimeofday,
[ __NR_settimeofday ] = (syscall_handler_t *) sys_settimeofday, [ __NR_settimeofday ] = (syscall_handler_t *) sys_settimeofday,
[ __NR_getgroups ] = (syscall_handler_t *) sys_getgroups16, [ __NR_getgroups ] = (syscall_handler_t *) sys_getgroups,
[ __NR_setgroups ] = (syscall_handler_t *) sys_setgroups16, [ __NR_setgroups ] = (syscall_handler_t *) sys_setgroups,
[ __NR_symlink ] = (syscall_handler_t *) sys_symlink, [ __NR_symlink ] = (syscall_handler_t *) sys_symlink,
[ __NR_readlink ] = (syscall_handler_t *) sys_readlink, [ __NR_readlink ] = (syscall_handler_t *) sys_readlink,
[ __NR_uselib ] = (syscall_handler_t *) sys_uselib, [ __NR_uselib ] = (syscall_handler_t *) sys_ni_syscall,
[ __NR_swapon ] = (syscall_handler_t *) sys_swapon, [ __NR_swapon ] = (syscall_handler_t *) sys_swapon,
[ __NR_reboot ] = (syscall_handler_t *) sys_reboot, [ __NR_reboot ] = (syscall_handler_t *) sys_reboot,
[ __NR_munmap ] = (syscall_handler_t *) sys_munmap, [ __NR_munmap ] = (syscall_handler_t *) sys_munmap,
[ __NR_truncate ] = (syscall_handler_t *) sys_truncate, [ __NR_truncate ] = (syscall_handler_t *) sys_truncate,
[ __NR_ftruncate ] = (syscall_handler_t *) sys_ftruncate, [ __NR_ftruncate ] = (syscall_handler_t *) sys_ftruncate,
[ __NR_fchmod ] = (syscall_handler_t *) sys_fchmod, [ __NR_fchmod ] = (syscall_handler_t *) sys_fchmod,
[ __NR_fchown ] = (syscall_handler_t *) sys_fchown16, [ __NR_fchown ] = (syscall_handler_t *) sys_fchown,
[ __NR_getpriority ] = (syscall_handler_t *) sys_getpriority, [ __NR_getpriority ] = (syscall_handler_t *) sys_getpriority,
[ __NR_setpriority ] = (syscall_handler_t *) sys_setpriority, [ __NR_setpriority ] = (syscall_handler_t *) sys_setpriority,
[ __NR_statfs ] = (syscall_handler_t *) sys_statfs, [ __NR_statfs ] = (syscall_handler_t *) sys_statfs,
...@@ -161,8 +156,8 @@ syscall_handler_t *sys_call_table[] = { ...@@ -161,8 +156,8 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_sysfs ] = (syscall_handler_t *) sys_sysfs, [ __NR_sysfs ] = (syscall_handler_t *) sys_sysfs,
[ __NR_personality ] = (syscall_handler_t *) sys_personality, [ __NR_personality ] = (syscall_handler_t *) sys_personality,
[ __NR_afs_syscall ] = (syscall_handler_t *) sys_ni_syscall, [ __NR_afs_syscall ] = (syscall_handler_t *) sys_ni_syscall,
[ __NR_setfsuid ] = (syscall_handler_t *) sys_setfsuid16, [ __NR_setfsuid ] = (syscall_handler_t *) sys_setfsuid,
[ __NR_setfsgid ] = (syscall_handler_t *) sys_setfsgid16, [ __NR_setfsgid ] = (syscall_handler_t *) sys_setfsgid,
[ __NR_getdents ] = (syscall_handler_t *) sys_getdents, [ __NR_getdents ] = (syscall_handler_t *) sys_getdents,
[ __NR_flock ] = (syscall_handler_t *) sys_flock, [ __NR_flock ] = (syscall_handler_t *) sys_flock,
[ __NR_msync ] = (syscall_handler_t *) sys_msync, [ __NR_msync ] = (syscall_handler_t *) sys_msync,
...@@ -185,13 +180,13 @@ syscall_handler_t *sys_call_table[] = { ...@@ -185,13 +180,13 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_sched_rr_get_interval ] = (syscall_handler_t *) sys_sched_rr_get_interval, [ __NR_sched_rr_get_interval ] = (syscall_handler_t *) sys_sched_rr_get_interval,
[ __NR_nanosleep ] = (syscall_handler_t *) sys_nanosleep, [ __NR_nanosleep ] = (syscall_handler_t *) sys_nanosleep,
[ __NR_mremap ] = (syscall_handler_t *) sys_mremap, [ __NR_mremap ] = (syscall_handler_t *) sys_mremap,
[ __NR_setresuid ] = (syscall_handler_t *) sys_setresuid16, [ __NR_setresuid ] = (syscall_handler_t *) sys_setresuid,
[ __NR_getresuid ] = (syscall_handler_t *) sys_getresuid16, [ __NR_getresuid ] = (syscall_handler_t *) sys_getresuid,
[ __NR_query_module ] = (syscall_handler_t *) sys_ni_syscall, [ __NR_query_module ] = (syscall_handler_t *) sys_ni_syscall,
[ __NR_poll ] = (syscall_handler_t *) sys_poll, [ __NR_poll ] = (syscall_handler_t *) sys_poll,
[ __NR_nfsservctl ] = (syscall_handler_t *) NFSSERVCTL, [ __NR_nfsservctl ] = (syscall_handler_t *) sys_nfsservctl,
[ __NR_setresgid ] = (syscall_handler_t *) sys_setresgid16, [ __NR_setresgid ] = (syscall_handler_t *) sys_setresgid,
[ __NR_getresgid ] = (syscall_handler_t *) sys_getresgid16, [ __NR_getresgid ] = (syscall_handler_t *) sys_getresgid,
[ __NR_prctl ] = (syscall_handler_t *) sys_prctl, [ __NR_prctl ] = (syscall_handler_t *) sys_prctl,
[ __NR_rt_sigreturn ] = (syscall_handler_t *) sys_rt_sigreturn, [ __NR_rt_sigreturn ] = (syscall_handler_t *) sys_rt_sigreturn,
[ __NR_rt_sigaction ] = (syscall_handler_t *) sys_rt_sigaction, [ __NR_rt_sigaction ] = (syscall_handler_t *) sys_rt_sigaction,
...@@ -202,12 +197,12 @@ syscall_handler_t *sys_call_table[] = { ...@@ -202,12 +197,12 @@ syscall_handler_t *sys_call_table[] = {
[ __NR_rt_sigsuspend ] = (syscall_handler_t *) sys_rt_sigsuspend, [ __NR_rt_sigsuspend ] = (syscall_handler_t *) sys_rt_sigsuspend,
[ __NR_pread64 ] = (syscall_handler_t *) sys_pread64, [ __NR_pread64 ] = (syscall_handler_t *) sys_pread64,
[ __NR_pwrite64 ] = (syscall_handler_t *) sys_pwrite64, [ __NR_pwrite64 ] = (syscall_handler_t *) sys_pwrite64,
[ __NR_chown ] = (syscall_handler_t *) sys_chown16, [ __NR_chown ] = (syscall_handler_t *) sys_chown,
[ __NR_getcwd ] = (syscall_handler_t *) sys_getcwd, [ __NR_getcwd ] = (syscall_handler_t *) sys_getcwd,
[ __NR_capget ] = (syscall_handler_t *) sys_capget, [ __NR_capget ] = (syscall_handler_t *) sys_capget,
[ __NR_capset ] = (syscall_handler_t *) sys_capset, [ __NR_capset ] = (syscall_handler_t *) sys_capset,
[ __NR_sigaltstack ] = (syscall_handler_t *) sys_sigaltstack, [ __NR_sigaltstack ] = (syscall_handler_t *) sys_sigaltstack,
[ __NR_sendfile ] = (syscall_handler_t *) sys_sendfile, [ __NR_sendfile ] = (syscall_handler_t *) sys_sendfile64,
[ __NR_getpmsg ] = (syscall_handler_t *) sys_ni_syscall, [ __NR_getpmsg ] = (syscall_handler_t *) sys_ni_syscall,
[ __NR_putpmsg ] = (syscall_handler_t *) sys_ni_syscall, [ __NR_putpmsg ] = (syscall_handler_t *) sys_ni_syscall,
[ __NR_vfork ] = (syscall_handler_t *) sys_vfork, [ __NR_vfork ] = (syscall_handler_t *) sys_vfork,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册