Skip to content

Commit 17d9822

Browse files
AlexGhitihdeller
authored andcommitted
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 <alex@ghiti.fr> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 37624b5 commit 17d9822

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/parisc/kernel/sys_parisc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ static unsigned long mmap_upper_limit(struct rlimit *rlim_stack)
8686
stack_base = STACK_SIZE_MAX;
8787

8888
/* Add space for stack randomization. */
89-
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
89+
if (current->flags & PF_RANDOMIZE)
90+
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
9091

9192
return PAGE_ALIGN(STACK_TOP - stack_base);
9293
}

0 commit comments

Comments
 (0)