mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-01 00:58:39 +02: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,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); | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Alexandre Ghiti
						Alexandre Ghiti