]> git.karo-electronics.de Git - karo-tx-linux.git/commit
s390/compat: fix mmap compat system calls
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 8 Aug 2012 07:32:20 +0000 (09:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Aug 2012 02:31:38 +0000 (19:31 -0700)
commit3e71cfc543f764241e9e0c9e2810fa4d8d0a6282
treefeeee2f87cae58a238ab2607fe3d4783bc41e6e4
parent0d6b40f647a7fc1acc74eb5b566d161113cbf310
s390/compat: fix mmap compat system calls

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 <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/kernel/compat_linux.c