From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759608AbYB2Tvb (ORCPT ); Fri, 29 Feb 2008 14:51:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933628AbYB2TvO (ORCPT ); Fri, 29 Feb 2008 14:51:14 -0500 Received: from smtp1.linux-foundation.org ([207.189.120.13]:55532 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760252AbYB2TvM (ORCPT ); Fri, 29 Feb 2008 14:51:12 -0500 Date: Fri, 29 Feb 2008 11:50:17 -0800 (PST) From: Linus Torvalds To: Jakub Jelinek cc: Ollie Wild , Peter Zijlstra , Michael Kerrisk , Andrew Morton , michael.kerrisk@gmail.com, carlos@codesourcery.com, Alan Cox , linux-kernel , drepper@redhat.com, mtk.manpages@gmail.com Subject: Re: [RFC/PATCH] RLIMIT_ARG_MAX In-Reply-To: <20080229190952.GM24887@devserv.devel.redhat.com> Message-ID: References: <1204119455.6242.403.camel@lappy> <1204305488.6243.113.camel@lappy> <1204306934.6243.119.camel@lappy> <65dd6fd50802291101j3786ee60iec0f3a24f5df9945@mail.gmail.com> <20080229190952.GM24887@devserv.devel.redhat.com> User-Agent: Alpine 1.00 (LFD 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Feb 2008, Jakub Jelinek wrote: > On Fri, Feb 29, 2008 at 11:01:38AM -0800, Ollie Wild wrote: > > > > This is precisely why I picked 25% as the maximum argument size ratio. > > In practice, that 25% can easily mean 50% or more. If people want to > > increase this, it can probably be tweaked somewhat, but switching it > > to, say, 50% probably isn't a good idea. > > I think 50% would be still fine. And, ideally make that > MAX (RLIMIT_STACK / 2, 128KB) to avoid regressions for programs which assume > they can pass ARG_MAX args+env, even if they have say 192KB stack limit. It would certainly be worth at least testing that as an approach. Another thing we could decide to do is to just check the size of the stack that is left at the end of all the stack setup code, and just say "if it's less than X bytes, just return ENOMEM rather than set up a process with a really unusably small stack". Linus