From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux-kernel@vger.kernel.org, arjan@linux.intel.com,
pavel@suse.cz, Ulrich Drepper <drepper@redhat.com>
Subject: Re: [PATCH] binfmt: turn MAX_ARG_PAGES into a sysctl tunable
Date: Tue, 27 Jun 2006 00:46:32 +0200 [thread overview]
Message-ID: <20060626224632.GA19183@elte.hu> (raw)
In-Reply-To: <20060626223526.GA18579@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
> * Linus Torvalds <torvalds@osdl.org> wrote:
>
> > I totally re-organized how execve() allocates the new mm at an execve
> > several years ago (it used to re-use the old MM if it could), and that
> > was so that we count just remove the brpm->page array, and just
> > install the pages directly into the destination.
> >
> > That was in 2002. I never actually got around to doing it ;(.
>
> i thought about your "map execve pages directly into target" (since the
> source gets destroyed anyway) suggestion back then, and unfortunately it
> gets quite complex.
>
> Firstly, if setenv is done and the array of strings gets larger, glibc
> realloc()s it and the layout of the environment gets 'fragmented'.
> Ulrich was uneasy about passing a fragmented environment to the target
> task - it's not sure that no app would break. Secondly, for security
> reasons we have to memset all the memory around fragmented strings. So
> we might end up doing _alot_ of memsetting in some cases, if the string
> space happens to be fragmented. So while the current method is slow and
> uses persistent memory, it at least "compresses" the layout of the
> environment (and arguments) at every exec() time and thus avoids these
> sorts of problems.
>
> And this is a real problem for real applications and is being complained
> about alot by shops that do alot of development and have scrips around
> large filesystem hierarchies. (and who got used to their scripts working
> on other unices just fine)
>
> Lets at least give root the chance to increase this limit and go with
> the dumb and easy patch i posted years ago. [...]
it's almost 5 years old:
http://people.redhat.com/mingo/execve-patches/exec-argsize-2.4.10-A3
( purely making the limit dynamic is not enough - bprm->pages needs to
become kmalloc()ed, plus i added a bprm->nr_pages so that decreasing
the limit becomes safe too.)
Ingo
next prev parent reply other threads:[~2006-06-26 22:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-23 10:54 [PATCH] binfmt: turn MAX_ARG_PAGES into a sysctl tunable Peter Zijlstra
2006-06-26 16:57 ` Andrew Morton
2006-06-26 17:21 ` Linus Torvalds
2006-06-26 22:35 ` Ingo Molnar
2006-06-26 22:46 ` Ingo Molnar [this message]
2006-06-26 23:02 ` Linus Torvalds
2006-06-27 11:09 ` Ingo Molnar
2006-06-27 12:16 ` Arjan van de Ven
2006-06-27 12:14 ` Ingo Molnar
2006-07-18 12:28 ` Peter Zijlstra
2006-06-28 1:07 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060626224632.GA19183@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@osdl.org \
--cc=arjan@linux.intel.com \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox