Commit c3359fbce4b65d542d02c30aa5174c8e4838da2d

Authored by Eric W. Biederman
1 parent 03102a4ded

sysctl: x86 Use the compat_sys_sysctl

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>

Showing 3 changed files with 1 additions and 62 deletions Side-by-side Diff

arch/x86/ia32/ia32entry.S
... ... @@ -653,7 +653,7 @@
653 653 .quad compat_sys_writev
654 654 .quad sys_getsid
655 655 .quad sys_fdatasync
656   - .quad sys32_sysctl /* sysctl */
  656 + .quad compat_sys_sysctl /* sysctl */
657 657 .quad sys_mlock /* 150 */
658 658 .quad sys_munlock
659 659 .quad sys_mlockall
arch/x86/ia32/sys_ia32.c
... ... @@ -434,62 +434,6 @@
434 434 return ret;
435 435 }
436 436  
437   -#ifdef CONFIG_SYSCTL_SYSCALL
438   -struct sysctl_ia32 {
439   - unsigned int name;
440   - int nlen;
441   - unsigned int oldval;
442   - unsigned int oldlenp;
443   - unsigned int newval;
444   - unsigned int newlen;
445   - unsigned int __unused[4];
446   -};
447   -
448   -
449   -asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32)
450   -{
451   - struct sysctl_ia32 a32;
452   - mm_segment_t old_fs = get_fs();
453   - void __user *oldvalp, *newvalp;
454   - size_t oldlen;
455   - int __user *namep;
456   - long ret;
457   -
458   - if (copy_from_user(&a32, args32, sizeof(a32)))
459   - return -EFAULT;
460   -
461   - /*
462   - * We need to pre-validate these because we have to disable
463   - * address checking before calling do_sysctl() because of
464   - * OLDLEN but we can't run the risk of the user specifying bad
465   - * addresses here. Well, since we're dealing with 32 bit
466   - * addresses, we KNOW that access_ok() will always succeed, so
467   - * this is an expensive NOP, but so what...
468   - */
469   - namep = compat_ptr(a32.name);
470   - oldvalp = compat_ptr(a32.oldval);
471   - newvalp = compat_ptr(a32.newval);
472   -
473   - if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
474   - || !access_ok(VERIFY_WRITE, namep, 0)
475   - || !access_ok(VERIFY_WRITE, oldvalp, 0)
476   - || !access_ok(VERIFY_WRITE, newvalp, 0))
477   - return -EFAULT;
478   -
479   - set_fs(KERNEL_DS);
480   - lock_kernel();
481   - ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
482   - newvalp, (size_t) a32.newlen);
483   - unlock_kernel();
484   - set_fs(old_fs);
485   -
486   - if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
487   - return -EFAULT;
488   -
489   - return ret;
490   -}
491   -#endif
492   -
493 437 /* warning: next two assume little endian */
494 438 asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
495 439 u32 poslo, u32 poshi)
arch/x86/include/asm/sys_ia32.h
... ... @@ -51,11 +51,6 @@
51 51 asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
52 52 asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
53 53  
54   -#ifdef CONFIG_SYSCTL_SYSCALL
55   -struct sysctl_ia32;
56   -asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
57   -#endif
58   -
59 54 asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
60 55 asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);
61 56