aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/compat_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/compat_linux.c')
-rw-r--r--arch/s390/kernel/compat_linux.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 0debcec23a39..fda1a8123f9b 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
527 return ret; 527 return ret;
528} 528}
529 529
530#ifdef CONFIG_SYSCTL_SYSCALL
531struct __sysctl_args32 {
532 u32 name;
533 int nlen;
534 u32 oldval;
535 u32 oldlenp;
536 u32 newval;
537 u32 newlen;
538 u32 __unused[4];
539};
540
541asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
542{
543 struct __sysctl_args32 tmp;
544 int error;
545 size_t oldlen;
546 size_t __user *oldlenp = NULL;
547 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
548
549 if (copy_from_user(&tmp, args, sizeof(tmp)))
550 return -EFAULT;
551
552 if (tmp.oldval && tmp.oldlenp) {
553 /* Duh, this is ugly and might not work if sysctl_args
554 is in read-only memory, but do_sysctl does indirectly
555 a lot of uaccess in both directions and we'd have to
556 basically copy the whole sysctl.c here, and
557 glibc's __sysctl uses rw memory for the structure
558 anyway. */
559 if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) ||
560 put_user(oldlen, (size_t __user *)addr))
561 return -EFAULT;
562 oldlenp = (size_t __user *)addr;
563 }
564
565 lock_kernel();
566 error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
567 oldlenp, compat_ptr(tmp.newval), tmp.newlen);
568 unlock_kernel();
569 if (oldlenp) {
570 if (!error) {
571 if (get_user(oldlen, (size_t __user *)addr) ||
572 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
573 error = -EFAULT;
574 }
575 if (copy_to_user(args->__unused, tmp.__unused,
576 sizeof(tmp.__unused)))
577 error = -EFAULT;
578 }
579 return error;
580}
581#endif
582
583struct stat64_emu31 { 530struct stat64_emu31 {
584 unsigned long long st_dev; 531 unsigned long long st_dev;
585 unsigned int __pad1; 532 unsigned int __pad1;