|
From: Nicholas N. <nj...@ca...> - 2004-02-14 15:23:08
|
On Mon, 9 Feb 2004, Jeremy Fitzhardinge wrote: > The check in the POST() functions is to make sure that > the kernel didn't allocate a client FD in Valgrind's reserved range. > Some syscalls, like dup2, allow the client to ask for any FD they want, > and others will just return the next available one, which may be in > Valgrind's range. In these cases we should close the FD and return > ENFILE (or maybe EMFILE). epoll should be the same. Attached patch does this, adding POST() checking for fcntl(), fcntl64(), socketcall.socketpair(), and futex(). Two things I'm not sure about: 1. There's a record_fd_open() in vg_syscalls.c:check_cmsg_for_fds(). I don't know if this needs to be checked; the man page says that recvmsg() can be used to pass fds over sockets... and EMFILE (or ENFILE) aren't among the error values that recvmsg() can return. 2. The man pages for futex() also don't list EMFILE (or ENFILE) as one of the allowed error values. Can someone else take a look at this? Thanks. N |