sysctl: mips Use the compat_sys_sysctl
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 3 Apr 2009 07:46:47 +0000 (00:46 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 6 Nov 2009 11:53:18 +0000 (03:53 -0800)
Now that we have a generic 32bit compatibility implementation
there is no need for mips to implement it's own.

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
arch/mips/kernel/linux32.c
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S

index b77fefaff9da2c5ab49f12da5ee069b754b5db5d..1a2793efdc4e2c45160f3ff71eca72082d180df9 100644 (file)
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
 }
 #endif
 
-struct sysctl_args32
-{
-       compat_caddr_t name;
-       int nlen;
-       compat_caddr_t oldval;
-       compat_caddr_t oldlenp;
-       compat_caddr_t newval;
-       compat_size_t newlen;
-       unsigned int __unused[4];
-};
-
-#ifdef CONFIG_SYSCTL_SYSCALL
-
-SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
-{
-       struct sysctl_args32 tmp;
-       int error;
-       size_t oldlen;
-       size_t __user *oldlenp = NULL;
-       unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
-
-       if (copy_from_user(&tmp, args, sizeof(tmp)))
-               return -EFAULT;
-
-       if (tmp.oldval && tmp.oldlenp) {
-               /* Duh, this is ugly and might not work if sysctl_args
-                  is in read-only memory, but do_sysctl does indirectly
-                  a lot of uaccess in both directions and we'd have to
-                  basically copy the whole sysctl.c here, and
-                  glibc's __sysctl uses rw memory for the structure
-                  anyway.  */
-               if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
-                   put_user(oldlen, (size_t __user *)addr))
-                       return -EFAULT;
-               oldlenp = (size_t __user *)addr;
-       }
-
-       lock_kernel();
-       error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
-                         oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
-       unlock_kernel();
-       if (oldlenp) {
-               if (!error) {
-                       if (get_user(oldlen, (size_t __user *)addr) ||
-                           put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
-                               error = -EFAULT;
-               }
-               copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
-       }
-       return error;
-}
-
-#else
-
-SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
-{
-       return -ENOSYS;
-}
-
-#endif /* CONFIG_SYSCTL_SYSCALL */
-
 SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
 {
        int ret = 0;
index 6ebc07976694bb03fed79e2026037f41d474fd04..8a0be0bdebadc7327b1ee689570f27eab73789d7 100644 (file)
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_munlockall
        PTR     sys_vhangup                     /* 6150 */
        PTR     sys_pivot_root
-       PTR     sys_32_sysctl
+       PTR     compat_sys_sysctl
        PTR     sys_prctl
        PTR     compat_sys_adjtimex
        PTR     compat_sys_setrlimit            /* 6155 */
index 14dde4ca932e287a9ef312f910c68fd87f3efd6d..41dbdb7d67e5873a892e85201c99993e10ee37c0 100644 (file)
@@ -356,7 +356,7 @@ sys_call_table:
        PTR     sys_ni_syscall                  /* 4150 */
        PTR     sys_getsid
        PTR     sys_fdatasync
-       PTR     sys_32_sysctl
+       PTR     compat_sys_sysctl
        PTR     sys_mlock
        PTR     sys_munlock                     /* 4155 */
        PTR     sys_mlockall