Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3492922imu; Sun, 11 Nov 2018 16:20:19 -0800 (PST) X-Google-Smtp-Source: AJdET5e30DtwhREXI0I7swrGTr1DToqubx+O8tWCR8Wl+2CB0gsNzA6Iaogamj0apooAXG/Y/Z8T X-Received: by 2002:a65:65c9:: with SMTP id y9mr15990120pgv.438.1541982019590; Sun, 11 Nov 2018 16:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541982019; cv=none; d=google.com; s=arc-20160816; b=SkKIKrepUod4iFRMY13QC3BCBWUzYIMW1/3SG8l6hohp6qVC1lvFNJI+9FeJFnpgby mVwvGZQxDGI+/AfVMFA6nBkcssW1K8WAjIoY1uwAVSYZwDX5XkdH5X+0IU3Hr8iyk21o qmrIrMLqcw9P6aA4J2A18LyOfC+cDlgGCemfzPq7Vbvlvz3klokWDo1bvovxdvUVHHpu EpP1UVNTmk5jFYYgViQgvxFZrVUdug4KUnh8PYhYGBW7JZKDeBxqpUEjDzdyiMBx7Hz/ 3eedsGqNI4cPsNWpoZLaa/HYVY3c5LT2nDWRGwW0dmG6jo9ADtYbrtORtoWs1V4TUl8M ZEkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2GOO/yQXpJFeLGZ41H7rNPN/e/n4cQmvyT5NXh4nO2w=; b=caKFWA6HakgRA8FaaMRaf/cwvT6EhgN+ErR9xHeeDBLR2EIJolPSRBoFoOp7IEsu+N fWLcHPQSfcg/gB+QEz2H7Jjyc3IOadIZ/VmCmZKZUU1QTsOZgkeW3YurG25RgPdkfq1u OBT+y9EsGSmwx32QQ4pSVId+QMO50crOYM9YIK4sexCHTt7TxovgCMXF5sxSo+fnLSat ythRp4JRYYQVB4IBfTtMRU1vfVtMkPYMk4+rVZTO3MBiUSZ19iIXh4vEzoLS5uS7LsAq jXjv+ZaiZ2LT+YKaPBy52zmrcfsJDivCYdOsgJRRg5k+Cd9nEaZKFSqjWliLlZOmib6i qepw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k4E8kkqx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11-v6si15828115plt.5.2018.11.11.16.20.04; Sun, 11 Nov 2018 16:20:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k4E8kkqx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730127AbeKLKKP (ORCPT + 99 others); Mon, 12 Nov 2018 05:10:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:58420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729768AbeKLIQy (ORCPT ); Mon, 12 Nov 2018 03:16:54 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCE9C2175B; Sun, 11 Nov 2018 22:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975218; bh=Rx3BK9wNQ7WRAINZj8JQsEa0Nf7iAX5LUk5+nLvsV2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k4E8kkqxzMhiyVwSU4uXp/4Ifen24sbTPQ1ZhP3eXuUm99c0ADcSP9ih+YD8N2w47 fx3bz3kPWnPHRRug3FMGOtZUEd+1tIgqsyKweaG6Q+4Z3elHVnfaaKcwu/nDK9c83G 8qRoheWiB6IsqcIxB4xoVApxqMy3XXYmmT/PpZFQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huacai Chen , Paul Burton , Ralf Baechle , James Hogan , linux-mips@linux-mips.org, Fuxin Zhang , Zhangjin Wu , Huacai Chen , Sasha Levin Subject: [PATCH 4.19 002/361] MIPS: VDSO: Reduce VDSO_RANDOMIZE_SIZE to 64MB for 64bit Date: Sun, 11 Nov 2018 14:15:49 -0800 Message-Id: <20181111221620.507857847@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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