Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753127AbdGFHfG (ORCPT ); Thu, 6 Jul 2017 03:35:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:48011 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752637AbdGFHfF (ORCPT ); Thu, 6 Jul 2017 03:35:05 -0400 Date: Thu, 6 Jul 2017 09:34:59 +0200 From: Michal Hocko To: Ben Hutchings Cc: Linus Torvalds , Willy Tarreau , 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: <20170706073457.GA32022@dhcp22.suse.cz> References: <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> <1499209315.2707.29.camel@decadent.org.uk> <20170705063645.GA10354@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170705063645.GA10354@dhcp22.suse.cz> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1427 Lines: 36 On Wed 05-07-17 08:36:45, Michal Hocko wrote: > On Tue 04-07-17 16:31:52, Linus Torvalds wrote: > > On Tue, Jul 4, 2017 at 4:01 PM, Ben Hutchings wrote: > > > > > > We have: > > > > > > bottom = 0xff803fff > > > sp = 0xffffb178 > > > > > > The relevant mappings are: > > > > > > ff7fc000-ff7fd000 rwxp 00000000 00:00 0 > > > fffdd000-ffffe000 rw-p 00000000 00:00 0 [stack] > > > > Ugh. So that stack is actually 8MB in size, but the alloca() is about > > to use up almost all of it, and there's only about 28kB left between > > "bottom" and that 'rwx' mapping. > > > > Still, that rwx mapping is interesting: it is a single page, and it > > really is almost exactly 8MB below the stack. > > > > In fact, the top of stack (at 0xffffe000) is *exactly* 8MB+4kB from > > the top of that odd one-page allocation (0xff7fd000). > > Very interesting! I would be really curious whether changing ulimit to > something bigger changes the picture. It's public holiday today here and I haven't read all new emails and I will be mostly offline today. I will catch up tomorrow. But before we go to more tricky workarounds. Could you double check that simply increasing the RLIMIT_STACK workarounds the problem here? Because if it does and other workarounds require some manual intervention then changing ulimit sounds like the least tricky one to me. -- Michal Hocko SUSE Labs