From: Greg Kroah-Hartman Date: Thu, 16 Aug 2012 22:56:55 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.5.3~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=480b35b7370fb95849c02b1dc4fe2829da1c3f94;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: s390-compat-fix-mmap-compat-system-calls.patch --- diff --git a/queue-3.0/s390-compat-fix-mmap-compat-system-calls.patch b/queue-3.0/s390-compat-fix-mmap-compat-system-calls.patch new file mode 100644 index 00000000000..8975b5fc2b4 --- /dev/null +++ b/queue-3.0/s390-compat-fix-mmap-compat-system-calls.patch @@ -0,0 +1,52 @@ +From e85871218513c54f7dfdb6009043cb638f2fecbe Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Wed, 8 Aug 2012 09:32:20 +0200 +Subject: s390/compat: fix mmap compat system calls + +From: Heiko Carstens + +commit e85871218513c54f7dfdb6009043cb638f2fecbe upstream. + +The native 31 bit and the compat behaviour for the mmap system calls differ: + +In native 31 bit mode the passed in address for the mmap system call will be +unmodified passed to sys_mmap_pgoff(). +In compat mode however the passed in address will be modified with +compat_ptr() which masks out the most significant bit. + +The result is that in native 31 bit mode each mmap request (with MAP_FIXED) +will fail where the most significat bit is set, while in compat mode it +may succeed. + +This odd behaviour was introduced with d3815898 "[S390] mmap: add missing +compat_ptr conversion to both mmap compat syscalls". + +To restore a consistent behaviour accross native and compat mode this +patch functionally reverts the above mentioned commit. + +Signed-off-by: Heiko Carstens +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/compat_linux.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/arch/s390/kernel/compat_linux.c ++++ b/arch/s390/kernel/compat_linux.c +@@ -631,7 +631,6 @@ asmlinkage unsigned long old32_mmap(stru + return -EFAULT; + if (a.offset & ~PAGE_MASK) + return -EINVAL; +- a.addr = (unsigned long) compat_ptr(a.addr); + return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, + a.offset >> PAGE_SHIFT); + } +@@ -642,7 +641,6 @@ asmlinkage long sys32_mmap2(struct mmap_ + + if (copy_from_user(&a, arg, sizeof(a))) + return -EFAULT; +- a.addr = (unsigned long) compat_ptr(a.addr); + return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); + } + diff --git a/queue-3.0/series b/queue-3.0/series new file mode 100644 index 00000000000..591b18477ed --- /dev/null +++ b/queue-3.0/series @@ -0,0 +1 @@ +s390-compat-fix-mmap-compat-system-calls.patch