diff options
28 files changed, 36 insertions, 123 deletions
diff --git a/arch/ia64/include/asm/compat.h b/arch/ia64/include/asm/compat.h index dfcf75b8426..f90edc85b50 100644 --- a/arch/ia64/include/asm/compat.h +++ b/arch/ia64/include/asm/compat.h | |||
@@ -5,7 +5,8 @@ | |||
5 | */ | 5 | */ |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | 7 | ||
8 | #define COMPAT_USER_HZ 100 | 8 | #define COMPAT_USER_HZ 100 |
9 | #define COMPAT_UTS_MACHINE "i686\0\0\0" | ||
9 | 10 | ||
10 | typedef u32 compat_size_t; | 11 | typedef u32 compat_size_t; |
11 | typedef s32 compat_ssize_t; | 12 | typedef s32 compat_ssize_t; |
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h index f58aed354bf..613f6912dfc 100644 --- a/arch/mips/include/asm/compat.h +++ b/arch/mips/include/asm/compat.h | |||
@@ -8,7 +8,8 @@ | |||
8 | #include <asm/page.h> | 8 | #include <asm/page.h> |
9 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
10 | 10 | ||
11 | #define COMPAT_USER_HZ 100 | 11 | #define COMPAT_USER_HZ 100 |
12 | #define COMPAT_UTS_MACHINE "mips\0\0\0" | ||
12 | 13 | ||
13 | typedef u32 compat_size_t; | 14 | typedef u32 compat_size_t; |
14 | typedef s32 compat_ssize_t; | 15 | typedef s32 compat_ssize_t; |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index bde79ef602e..a39d0597a37 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -249,22 +249,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, | |||
249 | } | 249 | } |
250 | #endif | 250 | #endif |
251 | 251 | ||
252 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) | ||
253 | { | ||
254 | int ret = 0; | ||
255 | |||
256 | down_read(&uts_sem); | ||
257 | if (copy_to_user(name, utsname(), sizeof *name)) | ||
258 | ret = -EFAULT; | ||
259 | up_read(&uts_sem); | ||
260 | |||
261 | if (current->personality == PER_LINUX32 && !ret) | ||
262 | if (copy_to_user(name->machine, "mips\0\0\0", 8)) | ||
263 | ret = -EFAULT; | ||
264 | |||
265 | return ret; | ||
266 | } | ||
267 | |||
268 | SYSCALL_DEFINE1(32_personality, unsigned long, personality) | 252 | SYSCALL_DEFINE1(32_personality, unsigned long, personality) |
269 | { | 253 | { |
270 | int ret; | 254 | int ret; |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 66b5a48676d..44337ba0371 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -181,7 +181,7 @@ EXPORT(sysn32_call_table) | |||
181 | PTR sys_exit | 181 | PTR sys_exit |
182 | PTR compat_sys_wait4 | 182 | PTR compat_sys_wait4 |
183 | PTR sys_kill /* 6060 */ | 183 | PTR sys_kill /* 6060 */ |
184 | PTR sys_32_newuname | 184 | PTR sys_newuname |
185 | PTR sys_semget | 185 | PTR sys_semget |
186 | PTR sys_semop | 186 | PTR sys_semop |
187 | PTR sys_n32_semctl | 187 | PTR sys_n32_semctl |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 515f9eab2b2..813689ef238 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -325,7 +325,7 @@ sys_call_table: | |||
325 | PTR sys32_sigreturn | 325 | PTR sys32_sigreturn |
326 | PTR sys32_clone /* 4120 */ | 326 | PTR sys32_clone /* 4120 */ |
327 | PTR sys_setdomainname | 327 | PTR sys_setdomainname |
328 | PTR sys_32_newuname | 328 | PTR sys_newuname |
329 | PTR sys_ni_syscall /* sys_modify_ldt */ | 329 | PTR sys_ni_syscall /* sys_modify_ldt */ |
330 | PTR compat_sys_adjtimex | 330 | PTR compat_sys_adjtimex |
331 | PTR sys_mprotect /* 4125 */ | 331 | PTR sys_mprotect /* 4125 */ |
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h index 7f32611a7a5..02b77baa5da 100644 --- a/arch/parisc/include/asm/compat.h +++ b/arch/parisc/include/asm/compat.h | |||
@@ -7,7 +7,8 @@ | |||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/thread_info.h> | 8 | #include <linux/thread_info.h> |
9 | 9 | ||
10 | #define COMPAT_USER_HZ 100 | 10 | #define COMPAT_USER_HZ 100 |
11 | #define COMPAT_UTS_MACHINE "parisc\0\0" | ||
11 | 12 | ||
12 | typedef u32 compat_size_t; | 13 | typedef u32 compat_size_t; |
13 | typedef s32 compat_ssize_t; | 14 | typedef s32 compat_ssize_t; |
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index 9147391afb0..c9b932260f4 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c | |||
@@ -234,18 +234,3 @@ long parisc_personality(unsigned long personality) | |||
234 | 234 | ||
235 | return err; | 235 | return err; |
236 | } | 236 | } |
237 | |||
238 | long parisc_newuname(struct new_utsname __user *name) | ||
239 | { | ||
240 | int err = sys_newuname(name); | ||
241 | |||
242 | #ifdef CONFIG_COMPAT | ||
243 | if (!err && personality(current->personality) == PER_LINUX32) { | ||
244 | if (__put_user(0, name->machine + 6) || | ||
245 | __put_user(0, name->machine + 7)) | ||
246 | err = -EFAULT; | ||
247 | } | ||
248 | #endif | ||
249 | |||
250 | return err; | ||
251 | } | ||
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index de5f6dab48b..3d52c978738 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
@@ -127,7 +127,7 @@ | |||
127 | ENTRY_SAME(socketpair) | 127 | ENTRY_SAME(socketpair) |
128 | ENTRY_SAME(setpgid) | 128 | ENTRY_SAME(setpgid) |
129 | ENTRY_SAME(send) | 129 | ENTRY_SAME(send) |
130 | ENTRY_OURS(newuname) | 130 | ENTRY_SAME(newuname) |
131 | ENTRY_SAME(umask) /* 60 */ | 131 | ENTRY_SAME(umask) /* 60 */ |
132 | ENTRY_SAME(chroot) | 132 | ENTRY_SAME(chroot) |
133 | ENTRY_COMP(ustat) | 133 | ENTRY_COMP(ustat) |
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index 4774c2f9223..396d21a8005 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
@@ -7,7 +7,8 @@ | |||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | 9 | ||
10 | #define COMPAT_USER_HZ 100 | 10 | #define COMPAT_USER_HZ 100 |
11 | #define COMPAT_UTS_MACHINE "ppc\0\0" | ||
11 | 12 | ||
12 | typedef u32 compat_size_t; | 13 | typedef u32 compat_size_t; |
13 | typedef s32 compat_ssize_t; | 14 | typedef s32 compat_ssize_t; |
diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h index 23bb74e7f94..4084e567d28 100644 --- a/arch/powerpc/include/asm/syscalls.h +++ b/arch/powerpc/include/asm/syscalls.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <asm/signal.h> | 8 | #include <asm/signal.h> |
9 | 9 | ||
10 | struct new_utsname; | ||
11 | struct pt_regs; | 10 | struct pt_regs; |
12 | struct rtas_args; | 11 | struct rtas_args; |
13 | struct sigaction; | 12 | struct sigaction; |
@@ -38,7 +37,6 @@ asmlinkage long sys_rt_sigaction(int sig, | |||
38 | asmlinkage long ppc64_personality(unsigned long personality); | 37 | asmlinkage long ppc64_personality(unsigned long personality); |
39 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); | 38 | asmlinkage int ppc_rtas(struct rtas_args __user *uargs); |
40 | asmlinkage time_t sys64_time(time_t __user * tloc); | 39 | asmlinkage time_t sys64_time(time_t __user * tloc); |
41 | asmlinkage long ppc_newuname(struct new_utsname __user * name); | ||
42 | 40 | ||
43 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, | 41 | asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset, |
44 | size_t sigsetsize); | 42 | size_t sigsetsize); |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 07d2d19ab5e..a5ee345b6a5 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -125,7 +125,7 @@ SYSCALL_SPU(fsync) | |||
125 | SYS32ONLY(sigreturn) | 125 | SYS32ONLY(sigreturn) |
126 | PPC_SYS(clone) | 126 | PPC_SYS(clone) |
127 | COMPAT_SYS_SPU(setdomainname) | 127 | COMPAT_SYS_SPU(setdomainname) |
128 | PPC_SYS_SPU(newuname) | 128 | SYSCALL_SPU(newuname) |
129 | SYSCALL(ni_syscall) | 129 | SYSCALL(ni_syscall) |
130 | COMPAT_SYS_SPU(adjtimex) | 130 | COMPAT_SYS_SPU(adjtimex) |
131 | SYSCALL_SPU(mprotect) | 131 | SYSCALL_SPU(mprotect) |
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index 5251221e7a5..69d3c5d50a5 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c | |||
@@ -132,19 +132,6 @@ static inline int override_machine(char __user *mach) | |||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
135 | long ppc_newuname(struct new_utsname __user * name) | ||
136 | { | ||
137 | int err = 0; | ||
138 | |||
139 | down_read(&uts_sem); | ||
140 | if (copy_to_user(name, utsname(), sizeof(*name))) | ||
141 | err = -EFAULT; | ||
142 | up_read(&uts_sem); | ||
143 | if (!err) | ||
144 | err = override_machine(name->machine); | ||
145 | return err; | ||
146 | } | ||
147 | |||
148 | int sys_uname(struct old_utsname __user *name) | 135 | int sys_uname(struct old_utsname __user *name) |
149 | { | 136 | { |
150 | int err = 0; | 137 | int err = 0; |
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 01a08020bc0..104f2007f09 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
@@ -35,7 +35,8 @@ | |||
35 | 35 | ||
36 | extern long psw32_user_bits; | 36 | extern long psw32_user_bits; |
37 | 37 | ||
38 | #define COMPAT_USER_HZ 100 | 38 | #define COMPAT_USER_HZ 100 |
39 | #define COMPAT_UTS_MACHINE "s390\0\0\0\0" | ||
39 | 40 | ||
40 | typedef u32 compat_size_t; | 41 | typedef u32 compat_size_t; |
41 | typedef s32 compat_ssize_t; | 42 | typedef s32 compat_ssize_t; |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 30de2d0e52b..672ce52341b 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper: | |||
547 | .globl sys32_newuname_wrapper | 547 | .globl sys32_newuname_wrapper |
548 | sys32_newuname_wrapper: | 548 | sys32_newuname_wrapper: |
549 | llgtr %r2,%r2 # struct new_utsname * | 549 | llgtr %r2,%r2 # struct new_utsname * |
550 | jg sys_s390_newuname # branch to system call | 550 | jg sys_newuname # branch to system call |
551 | 551 | ||
552 | .globl compat_sys_adjtimex_wrapper | 552 | .globl compat_sys_adjtimex_wrapper |
553 | compat_sys_adjtimex_wrapper: | 553 | compat_sys_adjtimex_wrapper: |
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index 15fd68b196c..eb15c12ec15 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -24,7 +24,6 @@ int __cpuinit start_secondary(void *cpuvoid); | |||
24 | void __init startup_init(void); | 24 | void __init startup_init(void); |
25 | void die(const char * str, struct pt_regs * regs, long err); | 25 | void die(const char * str, struct pt_regs * regs, long err); |
26 | 26 | ||
27 | struct new_utsname; | ||
28 | struct s390_mmap_arg_struct; | 27 | struct s390_mmap_arg_struct; |
29 | struct fadvise64_64_args; | 28 | struct fadvise64_64_args; |
30 | struct old_sigaction; | 29 | struct old_sigaction; |
@@ -32,7 +31,6 @@ struct old_sigaction; | |||
32 | long sys_mmap2(struct s390_mmap_arg_struct __user *arg); | 31 | long sys_mmap2(struct s390_mmap_arg_struct __user *arg); |
33 | long sys_s390_ipc(uint call, int first, unsigned long second, | 32 | long sys_s390_ipc(uint call, int first, unsigned long second, |
34 | unsigned long third, void __user *ptr); | 33 | unsigned long third, void __user *ptr); |
35 | long sys_s390_newuname(struct new_utsname __user *name); | ||
36 | long sys_s390_personality(unsigned long personality); | 34 | long sys_s390_personality(unsigned long personality); |
37 | long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, | 35 | long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, |
38 | size_t len, int advice); | 36 | size_t len, int advice); |
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index b8b78092ab7..7b6b0f81a28 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -131,17 +131,6 @@ SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second, | |||
131 | } | 131 | } |
132 | 132 | ||
133 | #ifdef CONFIG_64BIT | 133 | #ifdef CONFIG_64BIT |
134 | SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) | ||
135 | { | ||
136 | int ret = sys_newuname(name); | ||
137 | |||
138 | if (personality(current->personality) == PER_LINUX32 && !ret) { | ||
139 | ret = copy_to_user(name->machine, "s390\0\0\0\0", 8); | ||
140 | if (ret) ret = -EFAULT; | ||
141 | } | ||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | SYSCALL_DEFINE1(s390_personality, unsigned long, personality) | 134 | SYSCALL_DEFINE1(s390_personality, unsigned long, personality) |
146 | { | 135 | { |
147 | int ret; | 136 | int ret; |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 990ac8b321c..201ce6bed34 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -130,7 +130,7 @@ SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) | |||
130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) | 130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) |
131 | SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ | 131 | SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ |
132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) | 132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) |
133 | SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) | 133 | SYSCALL(sys_newuname,sys_newuname,sys32_newuname_wrapper) |
134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) |
136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ |
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index 0e706257918..5016f76ea98 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h | |||
@@ -5,7 +5,8 @@ | |||
5 | */ | 5 | */ |
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | 7 | ||
8 | #define COMPAT_USER_HZ 100 | 8 | #define COMPAT_USER_HZ 100 |
9 | #define COMPAT_UTS_MACHINE "sparc\0\0" | ||
9 | 10 | ||
10 | typedef u32 compat_size_t; | 11 | typedef u32 compat_size_t; |
11 | typedef s32 compat_ssize_t; | 12 | typedef s32 compat_ssize_t; |
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 45410e93962..3d435c42e6d 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c | |||
@@ -510,17 +510,6 @@ out: | |||
510 | return err; | 510 | return err; |
511 | } | 511 | } |
512 | 512 | ||
513 | SYSCALL_DEFINE1(sparc64_newuname, struct new_utsname __user *, name) | ||
514 | { | ||
515 | int ret = sys_newuname(name); | ||
516 | |||
517 | if (current->personality == PER_LINUX32 && !ret) { | ||
518 | ret = (copy_to_user(name->machine, "sparc\0\0", 8) | ||
519 | ? -EFAULT : 0); | ||
520 | } | ||
521 | return ret; | ||
522 | } | ||
523 | |||
524 | SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality) | 513 | SYSCALL_DEFINE1(sparc64_personality, unsigned long, personality) |
525 | { | 514 | { |
526 | int ret; | 515 | int ret; |
diff --git a/arch/sparc/kernel/systbls.h b/arch/sparc/kernel/systbls.h index 2c331c37e74..118759cd734 100644 --- a/arch/sparc/kernel/systbls.h +++ b/arch/sparc/kernel/systbls.h | |||
@@ -6,15 +6,12 @@ | |||
6 | #include <asm/utrap.h> | 6 | #include <asm/utrap.h> |
7 | #include <asm/signal.h> | 7 | #include <asm/signal.h> |
8 | 8 | ||
9 | struct new_utsname; | ||
10 | |||
11 | extern asmlinkage unsigned long sys_getpagesize(void); | 9 | extern asmlinkage unsigned long sys_getpagesize(void); |
12 | extern asmlinkage long sparc_pipe(struct pt_regs *regs); | 10 | extern asmlinkage long sparc_pipe(struct pt_regs *regs); |
13 | extern asmlinkage long sys_sparc_ipc(unsigned int call, int first, | 11 | extern asmlinkage long sys_sparc_ipc(unsigned int call, int first, |
14 | unsigned long second, | 12 | unsigned long second, |
15 | unsigned long third, | 13 | unsigned long third, |
16 | void __user *ptr, long fifth); | 14 | void __user *ptr, long fifth); |
17 | extern asmlinkage long sparc64_newuname(struct new_utsname __user *name); | ||
18 | extern asmlinkage long sparc64_personality(unsigned long personality); | 15 | extern asmlinkage long sparc64_personality(unsigned long personality); |
19 | extern asmlinkage long sys64_munmap(unsigned long addr, size_t len); | 16 | extern asmlinkage long sys64_munmap(unsigned long addr, size_t len); |
20 | extern asmlinkage unsigned long sys64_mremap(unsigned long addr, | 17 | extern asmlinkage unsigned long sys64_mremap(unsigned long addr, |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 30ca2b1d3a1..9db058dd039 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -55,7 +55,7 @@ sys_call_table32: | |||
55 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents | 55 | /*170*/ .word sys32_lsetxattr, sys32_fsetxattr, sys_getxattr, sys_lgetxattr, compat_sys_getdents |
56 | .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr | 56 | .word sys_setsid, sys_fchdir, sys32_fgetxattr, sys_listxattr, sys_llistxattr |
57 | /*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall | 57 | /*180*/ .word sys32_flistxattr, sys_removexattr, sys_lremovexattr, compat_sys_sigpending, sys_ni_syscall |
58 | .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_sparc64_newuname | 58 | .word sys32_setpgid, sys32_fremovexattr, sys32_tkill, sys32_exit_group, sys_newuname |
59 | /*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl | 59 | /*190*/ .word sys32_init_module, sys_sparc64_personality, sys_remap_file_pages, sys32_epoll_create, sys32_epoll_ctl |
60 | .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask | 60 | .word sys32_epoll_wait, sys32_ioprio_set, sys_getppid, sys32_sigaction, sys_sgetmask |
61 | /*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir | 61 | /*200*/ .word sys32_ssetmask, sys_sigsuspend, compat_sys_newlstat, sys_uselib, compat_sys_old_readdir |
@@ -130,7 +130,7 @@ sys_call_table: | |||
130 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents | 130 | /*170*/ .word sys_lsetxattr, sys_fsetxattr, sys_getxattr, sys_lgetxattr, sys_getdents |
131 | .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr | 131 | .word sys_setsid, sys_fchdir, sys_fgetxattr, sys_listxattr, sys_llistxattr |
132 | /*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall | 132 | /*180*/ .word sys_flistxattr, sys_removexattr, sys_lremovexattr, sys_nis_syscall, sys_ni_syscall |
133 | .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_sparc64_newuname | 133 | .word sys_setpgid, sys_fremovexattr, sys_tkill, sys_exit_group, sys_newuname |
134 | /*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl | 134 | /*190*/ .word sys_init_module, sys_sparc64_personality, sys_remap_file_pages, sys_epoll_create, sys_epoll_ctl |
135 | .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask | 135 | .word sys_epoll_wait, sys_ioprio_set, sys_getppid, sys_nis_syscall, sys_sgetmask |
136 | /*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall | 136 | /*200*/ .word sys_ssetmask, sys_nis_syscall, sys_newlstat, sys_uselib, sys_nis_syscall |
diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c index dd21d69715e..47d469e7e7c 100644 --- a/arch/um/sys-x86_64/syscall_table.c +++ b/arch/um/sys-x86_64/syscall_table.c | |||
@@ -26,11 +26,6 @@ | |||
26 | 26 | ||
27 | /* On UML we call it this way ("old" means it's not mmap2) */ | 27 | /* On UML we call it this way ("old" means it's not mmap2) */ |
28 | #define sys_mmap old_mmap | 28 | #define sys_mmap old_mmap |
29 | /* | ||
30 | * On x86-64 sys_uname is actually sys_newuname plus a compatibility trick. | ||
31 | * See arch/x86_64/kernel/sys_x86_64.c | ||
32 | */ | ||
33 | #define sys_uname sys_uname64 | ||
34 | 29 | ||
35 | #define stub_clone sys_clone | 30 | #define stub_clone sys_clone |
36 | #define stub_fork sys_fork | 31 | #define stub_fork sys_fork |
diff --git a/arch/um/sys-x86_64/syscalls.c b/arch/um/sys-x86_64/syscalls.c index f1199fd34d3..f3d82bb6e15 100644 --- a/arch/um/sys-x86_64/syscalls.c +++ b/arch/um/sys-x86_64/syscalls.c | |||
@@ -12,20 +12,6 @@ | |||
12 | #include "asm/uaccess.h" | 12 | #include "asm/uaccess.h" |
13 | #include "os.h" | 13 | #include "os.h" |
14 | 14 | ||
15 | asmlinkage long sys_uname64(struct new_utsname __user * name) | ||
16 | { | ||
17 | int err; | ||
18 | |||
19 | down_read(&uts_sem); | ||
20 | err = copy_to_user(name, utsname(), sizeof (*name)); | ||
21 | up_read(&uts_sem); | ||
22 | |||
23 | if (personality(current->personality) == PER_LINUX32) | ||
24 | err |= copy_to_user(&name->machine, "i686", 5); | ||
25 | |||
26 | return err ? -EFAULT : 0; | ||
27 | } | ||
28 | |||
29 | long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) | 15 | long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) |
30 | { | 16 | { |
31 | unsigned long *ptr = addr, tmp; | 17 | unsigned long *ptr = addr, tmp; |
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index 9a9c7bdc923..306160e58b4 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h | |||
@@ -8,7 +8,8 @@ | |||
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <asm/user32.h> | 9 | #include <asm/user32.h> |
10 | 10 | ||
11 | #define COMPAT_USER_HZ 100 | 11 | #define COMPAT_USER_HZ 100 |
12 | #define COMPAT_UTS_MACHINE "i686\0\0" | ||
12 | 13 | ||
13 | typedef u32 compat_size_t; | 14 | typedef u32 compat_size_t; |
14 | typedef s32 compat_ssize_t; | 15 | typedef s32 compat_ssize_t; |
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 50f6a569f0d..47cd606c353 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h | |||
@@ -68,11 +68,8 @@ int sys_vm86(unsigned long, unsigned long, struct pt_regs *); | |||
68 | long sys_arch_prctl(int, unsigned long); | 68 | long sys_arch_prctl(int, unsigned long); |
69 | 69 | ||
70 | /* kernel/sys_x86_64.c */ | 70 | /* kernel/sys_x86_64.c */ |
71 | struct new_utsname; | ||
72 | |||
73 | asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long, | 71 | asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long, |
74 | unsigned long, unsigned long, unsigned long); | 72 | unsigned long, unsigned long, unsigned long); |
75 | asmlinkage long sys_uname(struct new_utsname __user *); | ||
76 | 73 | ||
77 | #endif /* CONFIG_X86_32 */ | 74 | #endif /* CONFIG_X86_32 */ |
78 | #endif /* _ASM_X86_SYSCALLS_H */ | 75 | #endif /* _ASM_X86_SYSCALLS_H */ |
diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 4843f7ba754..83e2d6dc503 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h | |||
@@ -146,7 +146,7 @@ __SYSCALL(__NR_wait4, sys_wait4) | |||
146 | #define __NR_kill 62 | 146 | #define __NR_kill 62 |
147 | __SYSCALL(__NR_kill, sys_kill) | 147 | __SYSCALL(__NR_kill, sys_kill) |
148 | #define __NR_uname 63 | 148 | #define __NR_uname 63 |
149 | __SYSCALL(__NR_uname, sys_uname) | 149 | __SYSCALL(__NR_uname, sys_newuname) |
150 | 150 | ||
151 | #define __NR_semget 64 | 151 | #define __NR_semget 64 |
152 | __SYSCALL(__NR_semget, sys_semget) | 152 | __SYSCALL(__NR_semget, sys_semget) |
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index 8aa2057efd1..ff14a5044ce 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c | |||
@@ -209,15 +209,3 @@ bottomup: | |||
209 | 209 | ||
210 | return addr; | 210 | return addr; |
211 | } | 211 | } |
212 | |||
213 | |||
214 | SYSCALL_DEFINE1(uname, struct new_utsname __user *, name) | ||
215 | { | ||
216 | int err; | ||
217 | down_read(&uts_sem); | ||
218 | err = copy_to_user(name, utsname(), sizeof(*name)); | ||
219 | up_read(&uts_sem); | ||
220 | if (personality(current->personality) == PER_LINUX32) | ||
221 | err |= copy_to_user(&name->machine, "i686", 5); | ||
222 | return err ? -EFAULT : 0; | ||
223 | } | ||
diff --git a/kernel/sys.c b/kernel/sys.c index 9814e43fb23..e483eb5530e 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/task_io_accounting_ops.h> | 33 | #include <linux/task_io_accounting_ops.h> |
34 | #include <linux/seccomp.h> | 34 | #include <linux/seccomp.h> |
35 | #include <linux/cpu.h> | 35 | #include <linux/cpu.h> |
36 | #include <linux/personality.h> | ||
36 | #include <linux/ptrace.h> | 37 | #include <linux/ptrace.h> |
37 | #include <linux/fs_struct.h> | 38 | #include <linux/fs_struct.h> |
38 | 39 | ||
@@ -1114,6 +1115,15 @@ out: | |||
1114 | 1115 | ||
1115 | DECLARE_RWSEM(uts_sem); | 1116 | DECLARE_RWSEM(uts_sem); |
1116 | 1117 | ||
1118 | #ifdef COMPAT_UTS_MACHINE | ||
1119 | #define override_architecture(name) \ | ||
1120 | (current->personality == PER_LINUX32 && \ | ||
1121 | copy_to_user(name->machine, COMPAT_UTS_MACHINE, \ | ||
1122 | sizeof(COMPAT_UTS_MACHINE))) | ||
1123 | #else | ||
1124 | #define override_architecture(name) 0 | ||
1125 | #endif | ||
1126 | |||
1117 | SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) | 1127 | SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) |
1118 | { | 1128 | { |
1119 | int errno = 0; | 1129 | int errno = 0; |
@@ -1122,6 +1132,9 @@ SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name) | |||
1122 | if (copy_to_user(name, utsname(), sizeof *name)) | 1132 | if (copy_to_user(name, utsname(), sizeof *name)) |
1123 | errno = -EFAULT; | 1133 | errno = -EFAULT; |
1124 | up_read(&uts_sem); | 1134 | up_read(&uts_sem); |
1135 | |||
1136 | if (!errno && override_architecture(name)) | ||
1137 | errno = -EFAULT; | ||
1125 | return errno; | 1138 | return errno; |
1126 | } | 1139 | } |
1127 | 1140 | ||