]> git.baikalelectronics.ru Git - kernel.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)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 8 Aug 2012 14:32:57 +0000 (07:32 -0700)
commit5e1ff508acf889502b7fdd9ab1bc3fd0ab4df3f6
treeb50c4079fed166c1fd0e5b3de2a519bf617eb483
parent474bd86ab3ea720128555df8765e46776e9c1863
s390/compat: fix mmap compat system calls

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 f7a64a42 "[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.

Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/compat_linux.c