diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/mm/mmap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c index 6bcb045d2bd2..9b436c21195e 100644 --- a/arch/s390/mm/mmap.c +++ b/arch/s390/mm/mmap.c | |||
@@ -64,6 +64,11 @@ static unsigned long mmap_rnd(void) | |||
64 | return (get_random_int() & 0x7ffUL) << PAGE_SHIFT; | 64 | return (get_random_int() & 0x7ffUL) << PAGE_SHIFT; |
65 | } | 65 | } |
66 | 66 | ||
67 | static unsigned long mmap_base_legacy(void) | ||
68 | { | ||
69 | return TASK_UNMAPPED_BASE + mmap_rnd(); | ||
70 | } | ||
71 | |||
67 | static inline unsigned long mmap_base(void) | 72 | static inline unsigned long mmap_base(void) |
68 | { | 73 | { |
69 | unsigned long gap = rlimit(RLIMIT_STACK); | 74 | unsigned long gap = rlimit(RLIMIT_STACK); |
@@ -89,7 +94,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm) | |||
89 | * bit is set, or if the expected stack growth is unlimited: | 94 | * bit is set, or if the expected stack growth is unlimited: |
90 | */ | 95 | */ |
91 | if (mmap_is_legacy()) { | 96 | if (mmap_is_legacy()) { |
92 | mm->mmap_base = TASK_UNMAPPED_BASE; | 97 | mm->mmap_base = mmap_base_legacy(); |
93 | mm->get_unmapped_area = arch_get_unmapped_area; | 98 | mm->get_unmapped_area = arch_get_unmapped_area; |
94 | } else { | 99 | } else { |
95 | mm->mmap_base = mmap_base(); | 100 | mm->mmap_base = mmap_base(); |
@@ -164,7 +169,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm) | |||
164 | * bit is set, or if the expected stack growth is unlimited: | 169 | * bit is set, or if the expected stack growth is unlimited: |
165 | */ | 170 | */ |
166 | if (mmap_is_legacy()) { | 171 | if (mmap_is_legacy()) { |
167 | mm->mmap_base = TASK_UNMAPPED_BASE; | 172 | mm->mmap_base = mmap_base_legacy(); |
168 | mm->get_unmapped_area = s390_get_unmapped_area; | 173 | mm->get_unmapped_area = s390_get_unmapped_area; |
169 | } else { | 174 | } else { |
170 | mm->mmap_base = mmap_base(); | 175 | mm->mmap_base = mmap_base(); |