From: Sasha Levin Date: Tue, 6 Nov 2018 17:56:17 +0000 (-0500) Subject: queue mips-vdso-reduce-vdso_randomize_size-to-64mb-for-64b.patch for 4.19 X-Git-Tag: v3.18.125~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32d1db7dc1298c0ff23d09b25532dcfaf076c63f;p=thirdparty%2Fkernel%2Fstable-queue.git queue mips-vdso-reduce-vdso_randomize_size-to-64mb-for-64b.patch for 4.19 Signed-off-by: Sasha Levin --- diff --git a/queue-4.19/mips-vdso-reduce-vdso_randomize_size-to-64mb-for-64b.patch b/queue-4.19/mips-vdso-reduce-vdso_randomize_size-to-64mb-for-64b.patch new file mode 100644 index 00000000000..c3435e9b57d --- /dev/null +++ b/queue-4.19/mips-vdso-reduce-vdso_randomize_size-to-64mb-for-64b.patch @@ -0,0 +1,47 @@ +From 8d0d28a6ca5c6263e67aa633c138436b61c78cba Mon Sep 17 00:00:00 2001 +From: Huacai Chen +Date: Mon, 5 Nov 2018 22:58:30 +0000 +Subject: MIPS: VDSO: Reduce VDSO_RANDOMIZE_SIZE to 64MB for 64bit + +[ Upstream commit c61c7def1fa0a722610d89790e0255b74f3c07dd ] + +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 +Signed-off-by: Paul Burton +Fixes: ea7e0480a4b6 ("MIPS: VDSO: Always map near top of user memory") +Patchwork: https://patchwork.linux-mips.org/patch/20910/ +Cc: Ralf Baechle +Cc: James Hogan +Cc: linux-mips@linux-mips.org +Cc: Fuxin Zhang +Cc: Zhangjin Wu +Cc: Huacai Chen +Cc: stable@vger.kernel.org # 4.19 +Signed-off-by: Sasha Levin +--- + arch/mips/include/asm/processor.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h +index 49d6046ca1d0..c373eb605040 100644 +--- a/arch/mips/include/asm/processor.h ++++ b/arch/mips/include/asm/processor.h +@@ -81,7 +81,7 @@ extern unsigned int vced_count, vcei_count; + + #endif + +-#define VDSO_RANDOMIZE_SIZE (TASK_IS_32BIT_ADDR ? SZ_1M : SZ_256M) ++#define VDSO_RANDOMIZE_SIZE (TASK_IS_32BIT_ADDR ? SZ_1M : SZ_64M) + + extern unsigned long mips_stack_top(void); + #define STACK_TOP mips_stack_top() +-- +2.17.1 + diff --git a/queue-4.19/series b/queue-4.19/series index d0c3675a053..71d208ab114 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -1 +1,2 @@ bpf-fix-partial-copy-of-map_ptr-when-dst-is-scalar.patch +mips-vdso-reduce-vdso_randomize_size-to-64mb-for-64b.patch