From: Tom Hughes Date: Tue, 8 Jan 2008 13:54:43 +0000 (+0000) Subject: Valid file descriptor argument to llseek system call. X-Git-Tag: svn/VALGRIND_3_4_0~1111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e25736ec6cea37098a14f6fde969b5a89f34adf2;p=thirdparty%2Fvalgrind.git Valid file descriptor argument to llseek system call. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7322 --- diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index e276fa5ae0..c17f0ef3d9 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -582,7 +582,10 @@ PRE(sys_llseek) unsigned int, fd, unsigned long, offset_high, unsigned long, offset_low, vki_loff_t *, result, unsigned int, whence); - PRE_MEM_WRITE( "llseek(result)", ARG4, sizeof(vki_loff_t)); + if (!ML_(fd_allowed)(ARG1, "llseek", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); + else + PRE_MEM_WRITE( "llseek(result)", ARG4, sizeof(vki_loff_t)); } POST(sys_llseek) {