linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* execve manpage changes
@ 2007-08-07  0:38 Ollie Wild
  2007-08-07  0:46 ` Ollie Wild
  0 siblings, 1 reply; 4+ messages in thread
From: Ollie Wild @ 2007-08-07  0:38 UTC (permalink / raw)
  To: mtk-manpages; +Cc: linux-kernel

Michael,

Per our previous discussion, here are the updates to the execve(2)
manpage resulting from the variable length argument support patch in
linux-2.6.23-rc1.  The execve API is unmodified.  However, the
following should be noted in the "Notes" section.

Prior to linux-2.6.23, the memory used to store the environment and
argument list strings was limited to 32 (MAX_ARG_PAGES) pages.  On
most architectures, the page size is 4kB, leading to a maximum size of
128kB.

In linux-2.6.23 and later, most architectures support a size limit
derived from the current RLIMIT_STACK

^ permalink raw reply	[flat|nested] 4+ messages in thread

* execve manpage changes
  2007-08-07  0:38 execve manpage changes Ollie Wild
@ 2007-08-07  0:46 ` Ollie Wild
  2007-08-07 21:13   ` Michael Kerrisk
  2007-09-05 19:02   ` Michael Kerrisk
  0 siblings, 2 replies; 4+ messages in thread
From: Ollie Wild @ 2007-08-07  0:46 UTC (permalink / raw)
  To: mtk-manpages; +Cc: linux-kernel

Michael,

Per our previous discussion, here are the updates to the execve(2)
manpage resulting from the variable length argument support patch in
linux-2.6.23-rc1.  The execve API is unmodified.  However, the
following should be noted in the "Notes" section.

Prior to linux-2.6.23, the memory used to store the environment and
argument list strings was limited to 32 (MAX_ARG_PAGES) pages.  On
most architectures, the page size is 4kB, leading to a maximum size of
128kB.

In linux-2.6.23 and later, most architectures support a size limit
derived from the current RLIMIT_STACK setting (see getrlimit(2)).  For
these architectures, the total size is limited to 1/4 the allowed
stack size, the limit per string is 32 pages (MAX_ARG_STRLEN), and the
maximum number of strings is 0x7FFFFFFF.  Architectures with no memory
management unit are excepted: they maintain the pre-2.6.23 limit.

Ollie

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: execve manpage changes
  2007-08-07  0:46 ` Ollie Wild
@ 2007-08-07 21:13   ` Michael Kerrisk
  2007-09-05 19:02   ` Michael Kerrisk
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Kerrisk @ 2007-08-07 21:13 UTC (permalink / raw)
  To: Ollie Wild; +Cc: linux-kernel

Ollie Wild wrote:
> Michael,
> 
> Per our previous discussion, here are the updates to the execve(2)
> manpage resulting from the variable length argument support patch in
> linux-2.6.23-rc1.  The execve API is unmodified.  However, the
> following should be noted in the "Notes" section.
> 
> Prior to linux-2.6.23, the memory used to store the environment and
> argument list strings was limited to 32 (MAX_ARG_PAGES) pages.  On
> most architectures, the page size is 4kB, leading to a maximum size of
> 128kB.
> 
> In linux-2.6.23 and later, most architectures support a size limit
> derived from the current RLIMIT_STACK setting (see getrlimit(2)).  For
> these architectures, the total size is limited to 1/4 the allowed
> stack size, the limit per string is 32 pages (MAX_ARG_STRLEN), and the
> maximum number of strings is 0x7FFFFFFF.  Architectures with no memory
> management unit are excepted: they maintain the pre-2.6.23 limit.

Hello Ollie,

Thanks.  I'll see that this material makes it into a man pages release 
closer to the 2.6.23 final release.

Cheers,

Michael

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: execve manpage changes
  2007-08-07  0:46 ` Ollie Wild
  2007-08-07 21:13   ` Michael Kerrisk
@ 2007-09-05 19:02   ` Michael Kerrisk
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Kerrisk @ 2007-09-05 19:02 UTC (permalink / raw)
  To: Ollie Wild; +Cc: linux-kernel

Hello Ollie,

Ollie Wild wrote:
> Michael,
> 
> Per our previous discussion, here are the updates to the execve(2)
> manpage resulting from the variable length argument support patch in
> linux-2.6.23-rc1.  The execve API is unmodified.  However, the
> following should be noted in the "Notes" section.
> 
> Prior to linux-2.6.23, the memory used to store the environment and
> argument list strings was limited to 32 (MAX_ARG_PAGES) pages.  On
> most architectures, the page size is 4kB, leading to a maximum size of
> 128kB.
> 
> In linux-2.6.23 and later, most architectures support a size limit
> derived from the current RLIMIT_STACK setting (see getrlimit(2)).  For
> these architectures, the total size is limited to 1/4 the allowed
> stack size, the limit per string is 32 pages (MAX_ARG_STRLEN), and the
> maximum number of strings is 0x7FFFFFFF.  Architectures with no memory
> management unit are excepted: they maintain the pre-2.6.23 limit.

Thanks.  For man-pages-2.66 I have added the following text to execve.2:

   Limits on size of arguments + environment
       Most Unix implementations impose some limit on the total size
       of the command-line argument (argv)  and  environment  (envp)
       strings  that may be passed to a new program.  POSIX.1 allows
       an implementation to advertise this limit using  the  ARG_MAX
       constant  (either  defined  in <limits.h> or available at run
       time using the call sysconf(_SC_ARG_MAX)).

       On Linux prior to kernel 2.6.23, the memory used to store the
       environment  and  argument  strings  was  limited to 32 pages
       (defined by the kernel constant MAX_ARG_PAGES).  On architec-
       tures  with  a  4-kB page size, this yields a maximum size of
       128 kB.

       On kernel 2.6.23 and later, most architectures support a size
       limit  derived from the soft RLIMIT_STACK resource limit (see
       getrlimit(2)).  For these architectures, the  total  size  is
       limited  to  1/4  of  the  allowed  stack size, the limit per
       string is 32 pages (the kernel constant MAX_ARG_STRLEN),  and
       the  maximum  number  of strings is 0x7FFFFFFF.  (This change
       allows programs to have a much larger argument  and/or  envi-
       ronment  list.   Imposing  the 1/4-limit ensures that the new
       program always has some stack space.)  Architectures with  no
       memory  management  unit  are  excepted:  they  maintain  the
       pre-2.6.23 limit.

Cheers,

Michael

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7

Want to help with man page maintenance?  Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages/
read the HOWTOHELP file and grep the source files for 'FIXME'.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-09-05 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07  0:38 execve manpage changes Ollie Wild
2007-08-07  0:46 ` Ollie Wild
2007-08-07 21:13   ` Michael Kerrisk
2007-09-05 19:02   ` Michael Kerrisk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).