diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-01-13 14:44:39 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-01-13 14:44:45 -0500 |
commit | d381589834aa69f51f95b1e364fe79688692aab4 (patch) | |
tree | a8db6e97c21f5dc82aef3a89111d2260b79b92c6 /arch/s390 | |
parent | a9df8e325d0de527c2e97297704ebbec48c01cbf (diff) |
[S390] mmap: add missing compat_ptr conversion to both mmap compat syscalls
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 22c9e557bb22..11c3aba664ea 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -616,44 +616,35 @@ asmlinkage long sys32_fstatat64(unsigned int dfd, char __user *filename, | |||
616 | */ | 616 | */ |
617 | 617 | ||
618 | struct mmap_arg_struct_emu31 { | 618 | struct mmap_arg_struct_emu31 { |
619 | u32 addr; | 619 | compat_ulong_t addr; |
620 | u32 len; | 620 | compat_ulong_t len; |
621 | u32 prot; | 621 | compat_ulong_t prot; |
622 | u32 flags; | 622 | compat_ulong_t flags; |
623 | u32 fd; | 623 | compat_ulong_t fd; |
624 | u32 offset; | 624 | compat_ulong_t offset; |
625 | }; | 625 | }; |
626 | 626 | ||
627 | asmlinkage unsigned long | 627 | asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg) |
628 | old32_mmap(struct mmap_arg_struct_emu31 __user *arg) | ||
629 | { | 628 | { |
630 | struct mmap_arg_struct_emu31 a; | 629 | struct mmap_arg_struct_emu31 a; |
631 | int error = -EFAULT; | ||
632 | 630 | ||
633 | if (copy_from_user(&a, arg, sizeof(a))) | 631 | if (copy_from_user(&a, arg, sizeof(a))) |
634 | goto out; | 632 | return -EFAULT; |
635 | |||
636 | error = -EINVAL; | ||
637 | if (a.offset & ~PAGE_MASK) | 633 | if (a.offset & ~PAGE_MASK) |
638 | goto out; | 634 | return -EINVAL; |
639 | 635 | a.addr = (unsigned long) compat_ptr(a.addr); | |
640 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, | 636 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, |
641 | a.offset >> PAGE_SHIFT); | 637 | a.offset >> PAGE_SHIFT); |
642 | out: | ||
643 | return error; | ||
644 | } | 638 | } |
645 | 639 | ||
646 | asmlinkage long | 640 | asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) |
647 | sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg) | ||
648 | { | 641 | { |
649 | struct mmap_arg_struct_emu31 a; | 642 | struct mmap_arg_struct_emu31 a; |
650 | int error = -EFAULT; | ||
651 | 643 | ||
652 | if (copy_from_user(&a, arg, sizeof(a))) | 644 | if (copy_from_user(&a, arg, sizeof(a))) |
653 | goto out; | 645 | return -EFAULT; |
654 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); | 646 | a.addr = (unsigned long) compat_ptr(a.addr); |
655 | out: | 647 | return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); |
656 | return error; | ||
657 | } | 648 | } |
658 | 649 | ||
659 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) | 650 | asmlinkage long sys32_read(unsigned int fd, char __user * buf, size_t count) |