parisc: Consider stack randomization for mmap base only when necessary

Do not offset mmap base address because of stack randomization if
current task does not want randomization.

Signed-off-by: Alexandre Ghiti <[email protected]>
Signed-off-by: Helge Deller <[email protected]>
This commit is contained in:
Alexandre Ghiti authored and Helge Deller committed 2019-05-03 23:47:38 +02:00
1 parent 37624b5854
commit 17d9822d4b
1 file changed
+2 -1
+2 -1
View File
@@ -86,7 +86,8 @@ static unsigned long mmap_upper_limit(struct rlimit *rlim_stack)
stack_base = STACK_SIZE_MAX;
/* Add space for stack randomization. */
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
if (current->flags & PF_RANDOMIZE)
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
return PAGE_ALIGN(STACK_TOP - stack_base);
}