Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbdGDPwW (ORCPT ); Tue, 4 Jul 2017 11:52:22 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:53946 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752297AbdGDPwV (ORCPT ); Tue, 4 Jul 2017 11:52:21 -0400 Date: Tue, 4 Jul 2017 17:51:40 +0200 From: Willy Tarreau To: Ben Hutchings Cc: Michal Hocko , Linus Torvalds , Hugh Dickins , Oleg Nesterov , "Jason A. Donenfeld" , Rik van Riel , Larry Woodman , "Kirill A. Shutemov" , Tony Luck , "James E.J. Bottomley" , Helge Diller , James Hogan , Laura Abbott , Greg KH , "security@kernel.org" , linux-distros@vs.openwall.org, Qualys Security Advisory , LKML , Ximin Luo Subject: Re: [PATCH] mm: larger stack guard gap, between vmas Message-ID: <20170704155140.GC22013@1wt.eu> References: <1498009101.2655.6.camel@decadent.org.uk> <20170621092419.GA22051@dhcp22.suse.cz> <1498042057.2655.8.camel@decadent.org.uk> <1499126133.2707.20.camel@decadent.org.uk> <20170704084122.GC14722@dhcp22.suse.cz> <20170704093538.GF14722@dhcp22.suse.cz> <20170704094728.GB22013@1wt.eu> <20170704104211.GG14722@dhcp22.suse.cz> <20170704113611.GA4732@decadent.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170704113611.GA4732@decadent.org.uk> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 644 Lines: 22 On Tue, Jul 04, 2017 at 12:36:11PM +0100, Ben Hutchings wrote: > > If anywhing this would require to have a loop over all PROT_NONE > > mappings to not hit into other weird usecases. > > That's what I was thinking of. Tried the following patch: (...) > - next = vma->vm_next; > + /* > + * Allow VM_NONE mappings in the gap as some applications try > + * to make their own stack guards > + */ > + for (next = vma->vm_next; > + next && !(next->vm_flags & (VM_READ | VM_WRITE | VM_EXEC)); > + next = next->vm_next) > + ; That's what I wanted to propose but I feared someone would scream at me for this loop :-) +1 for me! Willy