aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/sys_sparc32.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2009-04-03 03:56:30 -0400
committerEric W. Biederman <ebiederm@xmission.com>2009-11-06 06:53:57 -0500
commit03102a4ded430586936445a733d0d29660f4d7c1 (patch)
tree55e8219e73b6a613ae0b0f28c213cfc8e8540d50 /arch/sparc/kernel/sys_sparc32.c
parent4ddf61ea99c1bbed4dcd889803c73213e1b3256b (diff)
sysctl: sparc Use the compat_sys_sysctl
Now that we have a generic 32bit compatibility implementation there is no need for sparc to implement it's own. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'arch/sparc/kernel/sys_sparc32.c')
-rw-r--r--arch/sparc/kernel/sys_sparc32.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c
index 04e28b2671c8..f862372074bc 100644
--- a/arch/sparc/kernel/sys_sparc32.c
+++ b/arch/sparc/kernel/sys_sparc32.c
@@ -591,63 +591,6 @@ out:
591 return ret; 591 return ret;
592} 592}
593 593
594struct __sysctl_args32 {
595 u32 name;
596 int nlen;
597 u32 oldval;
598 u32 oldlenp;
599 u32 newval;
600 u32 newlen;
601 u32 __unused[4];
602};
603
604asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
605{
606#ifndef CONFIG_SYSCTL_SYSCALL
607 return -ENOSYS;
608#else
609 struct __sysctl_args32 tmp;
610 int error;
611 size_t oldlen, __user *oldlenp = NULL;
612 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL;
613
614 if (copy_from_user(&tmp, args, sizeof(tmp)))
615 return -EFAULT;
616
617 if (tmp.oldval && tmp.oldlenp) {
618 /* Duh, this is ugly and might not work if sysctl_args
619 is in read-only memory, but do_sysctl does indirectly
620 a lot of uaccess in both directions and we'd have to
621 basically copy the whole sysctl.c here, and
622 glibc's __sysctl uses rw memory for the structure
623 anyway. */
624 if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) ||
625 put_user(oldlen, (size_t __user *)addr))
626 return -EFAULT;
627 oldlenp = (size_t __user *)addr;
628 }
629
630 lock_kernel();
631 error = do_sysctl((int __user *)(unsigned long) tmp.name,
632 tmp.nlen,
633 (void __user *)(unsigned long) tmp.oldval,
634 oldlenp,
635 (void __user *)(unsigned long) tmp.newval,
636 tmp.newlen);
637 unlock_kernel();
638 if (oldlenp) {
639 if (!error) {
640 if (get_user(oldlen, (size_t __user *)addr) ||
641 put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
642 error = -EFAULT;
643 }
644 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
645 error = -EFAULT;
646 }
647 return error;
648#endif
649}
650
651long sys32_lookup_dcookie(unsigned long cookie_high, 594long sys32_lookup_dcookie(unsigned long cookie_high,
652 unsigned long cookie_low, 595 unsigned long cookie_low,
653 char __user *buf, size_t len) 596 char __user *buf, size_t len)