|
From: <sv...@va...> - 2009-07-15 07:47:58
|
Author: tom
Date: 2009-07-15 08:47:49 +0100 (Wed, 15 Jul 2009)
New Revision: 10463
Log:
Validate the file descriptor argument to fallocate.
Modified:
trunk/coregrind/m_syswrap/syswrap-linux.c
Modified: trunk/coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-linux.c 2009-07-15 07:18:16 UTC (rev 10462)
+++ trunk/coregrind/m_syswrap/syswrap-linux.c 2009-07-15 07:47:49 UTC (rev 10463)
@@ -1155,6 +1155,8 @@
ARG1, ARG2, (Long)ARG3, (Long)ARG4);
PRE_REG_READ4(long, "fallocate",
int, fd, int, mode, vki_loff_t, offset, vki_loff_t, len);
+ if (!ML_(fd_allowed)(ARG1, "fallocate", tid, False))
+ SET_STATUS_Failure( VKI_EBADF );
}
/* ---------------------------------------------------------------------
|
|
From: Nicholas N. <n.n...@gm...> - 2009-07-15 08:11:09
|
On Wed, Jul 15, 2009 at 5:47 PM, <sv...@va...> wrote: > Author: tom > Date: 2009-07-15 08:47:49 +0100 (Wed, 15 Jul 2009) > New Revision: 10463 > > Log: > Validate the file descriptor argument to fallocate. Hmm, I was wondering if something like that was necessary but I was that fsync and fdatasync didn't have it, nor fadvise64 or fadvise64_64 or chown16 or fchown16. Looks like we're being inconsistent? Nick |
|
From: Tom H. <to...@co...> - 2009-07-15 08:46:45
|
On 15/07/09 09:11, Nicholas Nethercote wrote: > On Wed, Jul 15, 2009 at 5:47 PM,<sv...@va...> wrote: > >> Validate the file descriptor argument to fallocate. > > Hmm, I was wondering if something like that was necessary but I was > that fsync and fdatasync didn't have it, nor fadvise64 or fadvise64_64 > or chown16 or fchown16. Looks like we're being inconsistent? We probably are, yes. Tom -- Tom Hughes (to...@co...) http://www.compton.nu/ |