Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexandre Ghiti and committed by
Helge Deller
17d9822d 37624b58

+2 -1
+2 -1
arch/parisc/kernel/sys_parisc.c
··· 86 86 stack_base = STACK_SIZE_MAX; 87 87 88 88 /* 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); 90 91 91 92 return PAGE_ALIGN(STACK_TOP - stack_base); 92 93 }