mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
37624b5854
commit
17d9822d4b
1 changed files with 2 additions and 1 deletions
|
@ -86,6 +86,7 @@ static unsigned long mmap_upper_limit(struct rlimit *rlim_stack)
|
|||
stack_base = STACK_SIZE_MAX;
|
||||
|
||||
/* Add space for stack randomization. */
|
||||
if (current->flags & PF_RANDOMIZE)
|
||||
stack_base += (STACK_RND_MASK << PAGE_SHIFT);
|
||||
|
||||
return PAGE_ALIGN(STACK_TOP - stack_base);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue