aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/sys_sparc_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/sys_sparc_64.c')
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index cfa0e19abe3b..d77f54316948 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -365,6 +365,7 @@ EXPORT_SYMBOL(get_fb_unmapped_area);
365void arch_pick_mmap_layout(struct mm_struct *mm) 365void arch_pick_mmap_layout(struct mm_struct *mm)
366{ 366{
367 unsigned long random_factor = 0UL; 367 unsigned long random_factor = 0UL;
368 unsigned long gap;
368 369
369 if (current->flags & PF_RANDOMIZE) { 370 if (current->flags & PF_RANDOMIZE) {
370 random_factor = get_random_int(); 371 random_factor = get_random_int();
@@ -379,9 +380,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
379 * Fall back to the standard layout if the personality 380 * Fall back to the standard layout if the personality
380 * bit is set, or if the expected stack growth is unlimited: 381 * bit is set, or if the expected stack growth is unlimited:
381 */ 382 */
383 gap = rlimit(RLIMIT_STACK);
382 if (!test_thread_flag(TIF_32BIT) || 384 if (!test_thread_flag(TIF_32BIT) ||
383 (current->personality & ADDR_COMPAT_LAYOUT) || 385 (current->personality & ADDR_COMPAT_LAYOUT) ||
384 current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY || 386 gap == RLIM_INFINITY ||
385 sysctl_legacy_va_layout) { 387 sysctl_legacy_va_layout) {
386 mm->mmap_base = TASK_UNMAPPED_BASE + random_factor; 388 mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
387 mm->get_unmapped_area = arch_get_unmapped_area; 389 mm->get_unmapped_area = arch_get_unmapped_area;
@@ -389,9 +391,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
389 } else { 391 } else {
390 /* We know it's 32-bit */ 392 /* We know it's 32-bit */
391 unsigned long task_size = STACK_TOP32; 393 unsigned long task_size = STACK_TOP32;
392 unsigned long gap;
393 394
394 gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
395 if (gap < 128 * 1024 * 1024) 395 if (gap < 128 * 1024 * 1024)
396 gap = 128 * 1024 * 1024; 396 gap = 128 * 1024 * 1024;
397 if (gap > (task_size / 6 * 5)) 397 if (gap > (task_size / 6 * 5))