From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754925AbdGJSQH (ORCPT ); Mon, 10 Jul 2017 14:16:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:45708 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754569AbdGJSQF (ORCPT ); Mon, 10 Jul 2017 14:16:05 -0400 Date: Mon, 10 Jul 2017 20:16:00 +0200 From: Michal Hocko To: Kees Cook Cc: Linus Torvalds , Andy Lutomirski , Ben Hutchings , 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" , Qualys Security Advisory , LKML , Ximin Luo Subject: Re: [RFC][PATCH] exec: Use init rlimits for setuid exec Message-ID: <20170710181600.GG7071@dhcp22.suse.cz> References: <20170706043235.GA36170@beast> <20170710084415.GE19185@dhcp22.suse.cz> <20170710162751.GC7071@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170710162751.GC7071@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 On Mon 10-07-17 18:27:51, Michal Hocko wrote: > On Mon 10-07-17 09:12:11, Kees Cook wrote: [...] > > >> do_execveat_common() -> > > >> exec_binprm() -> > > >> search_binary_handler() -> > > >> fmt->load_binary (load_elf_binary()) -> > > >> setup_new_exec() -> > > >> arch_pick_mmap_layout() -> > > >> mmap_is_legacy() -> > > >> rlimit(RLIMIT_STACK) == RLIM_INFINITY > > > > > > FWIW this is gone in tip tree. See > > > lkml.kernel.org/r/20170614082218.12450-1-mhocko@kernel.org > > > > Sounds good to me, but won't large-memory users in 32-bit get annoyed? > > Why would they? 32b do bottom up layouts by default. OK, I misread the code. 32b applications on 64b systems do top down by default and only if they override this by ADDR_COMPAT_LAYOUT personality. For some reason I thought that 32b userspace goes a different path and makes sure that they are always doing bottom up. Anyway even if somebody really needs to grow stack really large we have the personality to give them the legacy layout. -- Michal Hocko SUSE Labs