diff options
| author | Michael Ellerman <mpe@ellerman.id.au> | 2017-07-31 20:20:29 +1000 | 
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-07-31 20:20:29 +1000 | 
| commit | bb272221e9db79f13d454e1f3fb6b05013be985e (patch) | |
| tree | 36f4acc50e3fabac71fadd34c720c0a6011db470 /arch/x86/mm/mmap.c | |
| parent | 253fd51e2f533552ae35a0c661705da6c4842c1b (diff) | |
| parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) | |
Merge tag 'v4.13-rc1' into fixes
The fixes branch is based off a random pre-rc1 commit, because we had
some fixes that needed to go in before rc1 was released.
However we now need to fix some code that went in after that point, but
before rc1, so merge rc1 to get that code into fixes so we can fix it!
Diffstat (limited to 'arch/x86/mm/mmap.c')
| -rw-r--r-- | arch/x86/mm/mmap.c | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c index 797295e792b2..229d04a83f85 100644 --- a/arch/x86/mm/mmap.c +++ b/arch/x86/mm/mmap.c @@ -92,13 +92,18 @@ unsigned long arch_mmap_rnd(void)  static unsigned long mmap_base(unsigned long rnd, unsigned long task_size)  {  	unsigned long gap = rlimit(RLIMIT_STACK); +	unsigned long pad = stack_maxrandom_size(task_size) + stack_guard_gap;  	unsigned long gap_min, gap_max; +	/* Values close to RLIM_INFINITY can overflow. */ +	if (gap + pad > gap) +		gap += pad; +  	/*  	 * Top of mmap area (just below the process stack).  	 * Leave an at least ~128 MB hole with possible stack randomization.  	 */ -	gap_min = SIZE_128M + stack_maxrandom_size(task_size); +	gap_min = SIZE_128M;  	gap_max = (task_size / 6) * 5;  	if (gap < gap_min)  | 
