Bug 13280

Summary: execve(2) does not honor sysconf(_SC_ARG_MAX) in some cases.
Product: glibc Reporter: Steven Drake <sdrake>
Component: libcAssignee: Ulrich Drepper <drepper.fsp>
Status: RESOLVED INVALID    
Severity: critical CC: carlos
Priority: P2 Keywords: testsuite
Version: 2.13Flags: fweimer: security-
Target Milestone: ---   
Host: x86_64-unknown-linux-gnu Target:
Build: Last reconfirmed:
Attachments: test-skeleton.c based test case (causes execve to fail with E2BIG).

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.