]> git.hungrycats.org Git - linux/commit
[PATCH] Fix race in epoll_ctl(EPOLL_CTL_MOD)
authorAndrew Morton <akpm@osdl.org>
Wed, 18 Feb 2004 12:57:25 +0000 (04:57 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 18 Feb 2004 12:57:25 +0000 (04:57 -0800)
commit2328d92a649711aed184534a0de0ee1d2e91d3ab
tree323a7af5f3aa3a07ea883ae0772f6410c04b7024
parent2268bb304be10a41c00781dd2a1cf981377c0923
[PATCH] Fix race in epoll_ctl(EPOLL_CTL_MOD)

From: Davide Libenzi <davidel@xmailserver.org>

A potential race can happen in epoll_ctl(EPOLL_CTL_MOD) where an event can
happen in between f_op->poll() and the lock on ep->lock (we cannot call
f_op->poll() inside a lock, and the f_op->poll() callback does not carry
any info at the current time - missing wake_up_info() already ;).  In that
case the event would be removed.  We can easily leave the event inside the
ready list and have the ep_send_events() logic do the job for us at later
time.  (Thanks to david.lee@teracruz.com for reporting the thing, since it
shouldn't have been a nice one ;)
fs/eventpoll.c