From: Julian Seward Date: Wed, 14 May 2008 12:18:48 +0000 (+0000) Subject: Merge r7322 (Valid file descriptor argument to llseek system call.) X-Git-Tag: svn/VALGRIND_3_3_1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45a81f6d4b8b192fa0e4f665ccb094e623fa3523;p=thirdparty%2Fvalgrind.git Merge r7322 (Valid file descriptor argument to llseek system call.) (What bug # does this fix?) git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_3_BRANCH@8073 --- 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) {