On Thu, 16 Jun 2005, Michael Kerrisk wrote:

Regarding this bug report:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=306517

I believe that the manual page probably correctly documents the
intended behaviour, but the implementation is wrong.  In
fs/eventpoll.c::sys_epoll_ctl(), I believe the following:

  error = -EFAULT;
  if (EP_OP_HASH_EVENT(op) &&
         copy_from_user(&epds, event, sizeof(struct epoll_event)))
    goto eexit_1;


Should be guarded by something like

 if (op != EPOLL_CTL_DEL)

But hopefully Davide (the implementer) can shed some light.

The code looks right to me. This is the EP_OP_HASH_EVENT() macro:

#define EP_OP_HASH_EVENT(op) ((op) != EPOLL_CTL_DEL)

If you call:

epoll_ctl(EPOLL_CTL_DEL, NULL);

you have that EP_OP_HASH_EVENT() is false, and hence the copy_from_user() in:

   error = -EFAULT;
   if (EP_OP_HASH_EVENT(op) &&
          copy_from_user(&epds, event, sizeof(struct epoll_event)))
     goto eexit_1;

is never executed. Has the bug report been run on recent kernels? That fix is pretty old though, I think about a year old.



- Davide



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to