Bug 13280 - execve(2) does not honor sysconf(_SC_ARG_MAX) in some cases.
Summary: execve(2) does not honor sysconf(_SC_ARG_MAX) in some cases.
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.13
: P2 critical
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords: testsuite
Depends on:
Blocks:
 
Reported: 2011-10-11 08:35 UTC by Steven Drake
Modified: 2014-06-13 10:43 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
test-skeleton.c based test case (causes execve to fail with E2BIG). (464 bytes, text/plain)
2011-10-11 08:35 UTC, Steven Drake
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Drake 2011-10-11 08:35:42 UTC
Created attachment 5974 [details]
test-skeleton.c based test case (causes execve to fail with E2BIG).

If execve is given an argv with a string that is larger than 131072 (coincidentally the ARG_MAX macro from linux/limits.h) but less than what sysconf(_SC_ARG_MAX) return, execve fails with E2BIG.

This does not happen if the total length of the argv strings is greater
than ARG_MAX but each is shorter.

This is a problem if using "/bin/sh -c", i.e. system(3).

I'm not sure if this is a glibc or linux issue but I am reporting it here
anyway.
Comment 1 Andreas Schwab 2011-10-11 08:51:48 UTC
execve is a plain system call.