]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
execve.2: Note that stack+environ size is also limited to 3/4 of _STK_LIM
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 5 May 2019 12:34:13 +0000 (07:34 -0500)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 5 May 2019 12:34:13 +0000 (07:34 -0500)
In fs/exec.c::prepare_arg_pages(), we have:

        limit = _STK_LIM / 4 * 3;
        limit = min(limit, bprm->rlim_stack.rlim_cur / 4);

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/execve.2

index 082bcb1a4c38fdef7d34fcd664723927975b7dbf..25360ceb15b0e8844a57e71f421f3366c94a3b23 100644 (file)
@@ -387,6 +387,10 @@ stack size.
 ensures that the new program always has some stack space.)
 .\" Ollie: That doesn't include the lists of pointers, though,
 .\" so the actual usage is a bit higher (1 pointer per argument).
+Additionally, the total size is limited to 3/4 of the value
+of the kernel constant
+.B _STK_LIM
+(8 Mibibytes).
 Since Linux 2.6.25,
 the kernel places a floor of 32 pages on this size limit,
 so that, even when