s390: limit brk randomization to 32MB
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 4 Mar 2019 11:33:28 +0000 (12:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2019 06:49:06 +0000 (08:49 +0200)
commitaa70f06710411f75a399505c32e2e273164b7577
treec2fc67d821e75506f50fc2fe07d0f0501e9864c5
parent9ab5cd3180d4a281bbae0be45b8f7ed4828e2d8a
s390: limit brk randomization to 32MB

[ Upstream commit cd479eccd2e057116d504852814402a1e68ead80 ]

For a 64-bit process the randomization of the program break is quite
large with 1GB. That is as big as the randomization of the anonymous
mapping base, for a test case started with '/lib/ld64.so.1 <exec>'
it can happen that the heap is placed after the stack. To avoid
this limit the program break randomization to 32MB for 64-bit and
keep 8MB for 31-bit.

Reported-by: Stefan Liebler <stli@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
arch/s390/include/asm/elf.h