aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/s390/include/asm/mman.h4
-rw-r--r--arch/s390/mm/mmap.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/arch/s390/include/asm/mman.h b/arch/s390/include/asm/mman.h
index 0e47a576d666..9977e08df5bd 100644
--- a/arch/s390/include/asm/mman.h
+++ b/arch/s390/include/asm/mman.h
@@ -9,7 +9,7 @@
9#include <uapi/asm/mman.h> 9#include <uapi/asm/mman.h>
10 10
11#if !defined(__ASSEMBLY__) && defined(CONFIG_64BIT) 11#if !defined(__ASSEMBLY__) && defined(CONFIG_64BIT)
12int s390_mmap_check(unsigned long addr, unsigned long len); 12int s390_mmap_check(unsigned long addr, unsigned long len, unsigned long flags);
13#define arch_mmap_check(addr,len,flags) s390_mmap_check(addr,len) 13#define arch_mmap_check(addr, len, flags) s390_mmap_check(addr, len, flags)
14#endif 14#endif
15#endif /* __S390_MMAN_H__ */ 15#endif /* __S390_MMAN_H__ */
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index c59a5efa58b1..06bafec00278 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)
101 101
102#else 102#else
103 103
104int s390_mmap_check(unsigned long addr, unsigned long len) 104int s390_mmap_check(unsigned long addr, unsigned long len, unsigned long flags)
105{ 105{
106 int rc; 106 int rc;
107 107
108 if (!is_compat_task() && 108 if (is_compat_task() || (TASK_SIZE >= (1UL << 53)))
109 len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) { 109 return 0;
110 if (!(flags & MAP_FIXED))
111 addr = 0;
112 if ((addr + len) >= TASK_SIZE) {
110 rc = crst_table_upgrade(current->mm, 1UL << 53); 113 rc = crst_table_upgrade(current->mm, 1UL << 53);
111 if (rc) 114 if (rc)
112 return rc; 115 return rc;