From: Tom Hughes Date: Sat, 25 Sep 2004 16:13:55 +0000 (+0000) Subject: Improve the checks in PRE(execve) to check that the file being executed X-Git-Tag: svn/VALGRIND_3_0_0~1565 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d73311ef70148621f1b4657d78cedfacc5a9e40;p=thirdparty%2Fvalgrind.git Improve the checks in PRE(execve) to check that the file being executed is a regular file and fail with EINVAL if it is not. This problem was highlight by bug 89481 although this doesn't solve the actual problem reported in that bug. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2723 --- diff --git a/coregrind/vg_syscalls.c b/coregrind/vg_syscalls.c index 60e13e415e..7f4153d843 100644 --- a/coregrind/vg_syscalls.c +++ b/coregrind/vg_syscalls.c @@ -1764,10 +1764,10 @@ PRE(execve) res = ret; return; } - /* just look for any X bit set + /* just look for regular file with any X bit set XXX do proper permissions check? */ - if ((st.st_mode & 0111) == 0) { + if ((st.st_mode & 0100111) == 0100000) { res = -VKI_EACCES; return; }