MIPS: VDSO: Reduce VDSO_RANDOMIZE_SIZE to 64MB for 64bit
authorHuacai Chen <chenhc@lemote.com>
Tue, 16 Oct 2018 01:20:42 +0000 (09:20 +0800)
committerPaul Burton <paul.burton@mips.com>
Tue, 16 Oct 2018 16:47:18 +0000 (09:47 -0700)
commitc61c7def1fa0a722610d89790e0255b74f3c07dd
tree4bcb1b1ff9119b9cc5d3a1febccfc644dee8e8c5
parent3f2aa244ee1a0d17ed5b6c86564d2c1b24d1c96b
MIPS: VDSO: Reduce VDSO_RANDOMIZE_SIZE to 64MB for 64bit

Commit ea7e0480a4b6 ("MIPS: VDSO: Always map near top of user memory")
set VDSO_RANDOMIZE_SIZE to 256MB for 64bit kernel. But take a look at
arch/mips/mm/mmap.c we can see that MIN_GAP is 128MB, which means the
mmap_base may be at (user_address_top - 128MB). This make the stack be
surrounded by mmaped areas, then stack expanding fails and causes a
segmentation fault. Therefore, VDSO_RANDOMIZE_SIZE should be less than
MIN_GAP and this patch reduce it to 64MB.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: ea7e0480a4b6 ("MIPS: VDSO: Always map near top of user memory")
Patchwork: https://patchwork.linux-mips.org/patch/20910/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: Huacai Chen <chenhuacai@gmail.com>
arch/mips/include/asm/processor.h