Bug 12241 - execve() doesn't return with errono=ENOENT for executable w/o required shared libs.
Summary: execve() doesn't return with errono=ENOENT for executable w/o required shared...
Status: RESOLVED WONTFIX
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.12
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-19 14:16 UTC by Pawel Sikora
Modified: 2014-06-13 10:43 UTC (History)
0 users

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


Attachments
testcase (5.21 KB, application/octet-stream)
2010-11-19 14:16 UTC, Pawel Sikora
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Sikora 2010-11-19 14:16:50 UTC
Created attachment 5130 [details]
testcase

hi,

on execve() man page:
http://www.kernel.org/doc/man-pages/online/pages/man2/execve.2.html
we can read:

(...)
RETURN VALUE
 On success, execve() does not return, on error -1 is returned,
 and errno is set appropriately.
(...)
 ENOENT
 The file filename or a script or ELF interpreter does not exist,
 or a shared library needed for file or interpreter cannot be found.
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                ^^^^^^^^^^^^^^^^

but in the real world the execve() doesn't return if i accidentaly
try to run a child process w/o required shared libs on search path.

$ make
gcc -Wall -g2 parent.c -o parent
gcc -Wall -g2 hello.c -shared -fpic -o libhello.so
gcc -Wall -g2 child.c -o child ./libhello.so
rm libhello.so
./parent
<program name unknown>: error while loading shared libraries:
 ./libhello.so: cannot open shared object file: No such file or directory
Comment 1 Ulrich Drepper 2010-11-19 14:37:09 UTC
Then get the man page changed.  It has to follow the implementation and not the other way round.