s390/mmap: take stack_guard_gap into account for mmap_base
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 29 Jan 2019 09:48:09 +0000 (10:48 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 7 Feb 2019 10:57:01 +0000 (11:57 +0100)
commita0308c1315e72b6fdce7b419c4546dad568b3a83
treea0394e6ad255922ab96a2895d9e759b530b992fd
parentd4192437d75ae4f401aac5d54229756829015e1d
s390/mmap: take stack_guard_gap into account for mmap_base

The s390 version of the mmap_base function is ignorant of stack_guard_gap
which can lead to a placement of the stack vs. the mmap base that does not
leave enough space for the stack rlimit.

Add the stack_guard_gap to the calculation and while we are at it the
check for gap+pad overflows as well.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/mmap.c