parisc: Allow mmap(MAP_STACK) memory to automatically expand upwards
authorHelge Deller <deller@kernel.org>
Sun, 8 Sep 2024 18:51:17 +0000 (20:51 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 16 Sep 2024 21:01:43 +0000 (23:01 +0200)
commit5d698966fa7b452035c44c937d704910bf3440dd
tree44b949404fa973cc06237d42df6e8e7f4e1bc01c
parent75f653f0c6318ae0acfd6277efba3f9bd7cf837c
parisc: Allow mmap(MAP_STACK) memory to automatically expand upwards

When userspace allocates memory with mmap() in order to be used for stack,
allow this memory region to automatically expand upwards up until the
current maximum process stack size.
The fault handler checks if the VM_GROWSUP bit is set in the vm_flags field
of a memory area before it allows it to expand.
This patch modifies the parisc specific code only.
A RFC for a generic patch to modify mmap() for all architectures was sent
to the mailing list but did not get enough Acks.

Reported-by: Camm Maguire <camm@maguirefamily.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # v5.10+
arch/parisc/include/asm/mman.h