From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752470AbdGEVSw (ORCPT ); Wed, 5 Jul 2017 17:18:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56452 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752156AbdGEVSv (ORCPT ); Wed, 5 Jul 2017 17:18:51 -0400 Date: Wed, 5 Jul 2017 14:18:49 -0700 From: Andrew Morton To: Michal Hocko Cc: Linus Torvalds , Vlastimil Babka , Ben Hutchings , Willy Tarreau , Oleg Nesterov , Rik van Riel , LKML , linux-mm Subject: Re: [PATCH] mm: mm, mmap: do not blow on PROT_NONE MAP_FIXED holes in the stack Message-Id: <20170705141849.2e0e4721d975277183eb178f@linux-foundation.org> In-Reply-To: <20170705182849.GA18027@dhcp22.suse.cz> References: <20170705165602.15005-1-mhocko@kernel.org> <20170705182849.GA18027@dhcp22.suse.cz> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 Jul 2017 20:28:49 +0200 Michal Hocko wrote: > "mm: enlarge stack guard gap" has introduced a regression in some rust > and Java environments which are trying to implement their own stack > guard page. They are punching a new MAP_FIXED mapping inside the > existing stack Vma. > > This will confuse expand_{downwards,upwards} into thinking that the stack > expansion would in fact get us too close to an existing non-stack vma > which is a correct behavior wrt. safety. It is a real regression on > the other hand. Let's work around the problem by considering PROT_NONE > mapping as a part of the stack. This is a gros hack but overflowing to > such a mapping would trap anyway an we only can hope that usespace > knows what it is doing and handle it propely. > > Fixes: d4d2d35e6ef9 ("mm: larger stack guard gap, between vmas") That should be 1be7107fbe18, yes? > Debugged-by: Vlastimil Babka > Signed-off-by: Michal Hocko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f200.google.com (mail-wr0-f200.google.com [209.85.128.200]) by kanga.kvack.org (Postfix) with ESMTP id C7DE46B03A5 for ; Wed, 5 Jul 2017 17:18:53 -0400 (EDT) Received: by mail-wr0-f200.google.com with SMTP id z81so316097wrc.2 for ; Wed, 05 Jul 2017 14:18:53 -0700 (PDT) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org. [140.211.169.12]) by mx.google.com with ESMTPS id k8si17040412wmh.116.2017.07.05.14.18.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jul 2017 14:18:52 -0700 (PDT) Date: Wed, 5 Jul 2017 14:18:49 -0700 From: Andrew Morton Subject: Re: [PATCH] mm: mm, mmap: do not blow on PROT_NONE MAP_FIXED holes in the stack Message-Id: <20170705141849.2e0e4721d975277183eb178f@linux-foundation.org> In-Reply-To: <20170705182849.GA18027@dhcp22.suse.cz> References: <20170705165602.15005-1-mhocko@kernel.org> <20170705182849.GA18027@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Linus Torvalds , Vlastimil Babka , Ben Hutchings , Willy Tarreau , Oleg Nesterov , Rik van Riel , LKML , linux-mm On Wed, 5 Jul 2017 20:28:49 +0200 Michal Hocko wrote: > "mm: enlarge stack guard gap" has introduced a regression in some rust > and Java environments which are trying to implement their own stack > guard page. They are punching a new MAP_FIXED mapping inside the > existing stack Vma. > > This will confuse expand_{downwards,upwards} into thinking that the stack > expansion would in fact get us too close to an existing non-stack vma > which is a correct behavior wrt. safety. It is a real regression on > the other hand. Let's work around the problem by considering PROT_NONE > mapping as a part of the stack. This is a gros hack but overflowing to > such a mapping would trap anyway an we only can hope that usespace > knows what it is doing and handle it propely. > > Fixes: d4d2d35e6ef9 ("mm: larger stack guard gap, between vmas") That should be 1be7107fbe18, yes? > Debugged-by: Vlastimil Babka > Signed-off-by: Michal Hocko -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org