summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHendrik Brueckner <brueckner@linux.vnet.ibm.com>2013-02-11 14:29:49 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-02-14 15:55:22 +0100
commit486c0a0bc80d370471b21662bf03f04fbb37cdc6 (patch)
tree29b538296d454871ba0b4dd9802e0e154eb2102b /arch/s390/mm
parenta4e69245bd7793a620ed67442c00fa1f2dd56891 (diff)
downloadop-kernel-dev-486c0a0bc80d370471b21662bf03f04fbb37cdc6.zip
op-kernel-dev-486c0a0bc80d370471b21662bf03f04fbb37cdc6.tar.gz
s390/mm: Fix crst upgrade of mmap with MAP_FIXED
Right now the page table upgrade does not happen if the end address of a fixed mapping is greater than TASK_SIZE. Enhance s390_mmap_check() to handle MAP_FIXED mappings correctly. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/mmap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index c59a5ef..06bafec 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -101,12 +101,15 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
#else
-int s390_mmap_check(unsigned long addr, unsigned long len)
+int s390_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
{
int rc;
- if (!is_compat_task() &&
- len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) {
+ if (is_compat_task() || (TASK_SIZE >= (1UL << 53)))
+ return 0;
+ if (!(flags & MAP_FIXED))
+ addr = 0;
+ if ((addr + len) >= TASK_SIZE) {
rc = crst_table_upgrade(current->mm, 1UL << 53);
if (rc)
return rc;
OpenPOWER on IntegriCloud