]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
sysctl: x86 Use the compat_sys_sysctl
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 3 Apr 2009 07:59:52 +0000 (00:59 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 6 Nov 2009 11:53:58 +0000 (03:53 -0800)
Now that we have a generic 32bit compatibility implementation
there is no need for x86 to implement it's own.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
arch/x86/ia32/ia32entry.S
arch/x86/ia32/sys_ia32.c
arch/x86/include/asm/sys_ia32.h

index 581b0568fe1941e9cf18c730138b9dbf0ff8c815..5d2584839be46200e72caec55fae542eed4a0001 100644 (file)
@@ -653,7 +653,7 @@ ia32_sys_call_table:
        .quad compat_sys_writev
        .quad sys_getsid
        .quad sys_fdatasync
-       .quad sys32_sysctl      /* sysctl */
+       .quad compat_sys_sysctl /* sysctl */
        .quad sys_mlock         /* 150 */
        .quad sys_munlock
        .quad sys_mlockall
index 9f55271988250fadf2562a7f5f61bc9c815dc38c..df82c0e48dedff5c7ac9ac8d89ea96be2599e3af 100644 (file)
@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
        return ret;
 }
 
-#ifdef CONFIG_SYSCTL_SYSCALL
-struct sysctl_ia32 {
-       unsigned int    name;
-       int             nlen;
-       unsigned int    oldval;
-       unsigned int    oldlenp;
-       unsigned int    newval;
-       unsigned int    newlen;
-       unsigned int    __unused[4];
-};
-
-
-asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32)
-{
-       struct sysctl_ia32 a32;
-       mm_segment_t old_fs = get_fs();
-       void __user *oldvalp, *newvalp;
-       size_t oldlen;
-       int __user *namep;
-       long ret;
-
-       if (copy_from_user(&a32, args32, sizeof(a32)))
-               return -EFAULT;
-
-       /*
-        * We need to pre-validate these because we have to disable
-        * address checking before calling do_sysctl() because of
-        * OLDLEN but we can't run the risk of the user specifying bad
-        * addresses here.  Well, since we're dealing with 32 bit
-        * addresses, we KNOW that access_ok() will always succeed, so
-        * this is an expensive NOP, but so what...
-        */
-       namep = compat_ptr(a32.name);
-       oldvalp = compat_ptr(a32.oldval);
-       newvalp =  compat_ptr(a32.newval);
-
-       if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
-           || !access_ok(VERIFY_WRITE, namep, 0)
-           || !access_ok(VERIFY_WRITE, oldvalp, 0)
-           || !access_ok(VERIFY_WRITE, newvalp, 0))
-               return -EFAULT;
-
-       set_fs(KERNEL_DS);
-       lock_kernel();
-       ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
-                       newvalp, (size_t) a32.newlen);
-       unlock_kernel();
-       set_fs(old_fs);
-
-       if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
-               return -EFAULT;
-
-       return ret;
-}
-#endif
-
 /* warning: next two assume little endian */
 asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
                            u32 poslo, u32 poshi)
index 72a6dcd1299b6154562f5717c9ef751a9e287dc2..9af9decb38c35fd1a109839e096701a549dd258d 100644 (file)
@@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
 asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
 asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
 
-#ifdef CONFIG_SYSCTL_SYSCALL
-struct sysctl_ia32;
-asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
-#endif
-
 asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
 asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);