summaryrefslogtreecommitdiffstats
path: root/arch/parisc
diff options
context:
space:
mode:
authorAlexandre Ghiti <alex@ghiti.fr>2019-04-04 02:26:22 -0400
committerHelge Deller <deller@gmx.de>2019-05-03 23:47:38 +0200
commit17d9822d4b4c1bfeb14971d9a2639698e7f5b1eb (patch)
treee7317d1feba8497929bb36676d3e435527033748 /arch/parisc
parent37624b58542fb9f2d9a70e6ea006ef8a5f66c30b (diff)
downloadlinux-17d9822d4b4c1bfeb14971d9a2639698e7f5b1eb.tar.gz
linux-17d9822d4b4c1bfeb14971d9a2639698e7f5b1eb.tar.bz2
linux-17d9822d4b4c1bfeb14971d9a2639698e7f5b1eb.zip
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>
Diffstat (limited to 'arch/parisc')
-rw-r--r--arch/parisc/kernel/sys_parisc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 376ea0d1b275..4407ac4c1d84 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -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);
}