]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
eventpoll: refresh eventpoll_release() fast-path comment
authorChristian Brauner <brauner@kernel.org>
Thu, 23 Apr 2026 09:56:11 +0000 (11:56 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 23 Apr 2026 22:36:50 +0000 (00:36 +0200)
commit33e92e9ecf48c08cb4807e9a36f9eb01619c1a1e
tree3db1462c972a1b2d704cd4ab21a8b7035a460b78
parentd30deeb8b0cf6259785c1fb79b87905d281b0a5a
eventpoll: refresh eventpoll_release() fast-path comment

The old comment justified the lockless READ_ONCE(file->f_ep) check
with "False positives simply cannot happen because the file is on
the way to be removed and nobody ( but eventpoll ) has still a
reference to this file." That reasoning was the root of the UAF
fixed in "eventpoll: fix ep_remove struct eventpoll / struct file
UAF": __ep_remove() could clear f_ep while another close raced
past the fast path and freed the watched eventpoll / recycled the
struct file slot.

With ep_remove() now pinning @file via epi_fget() across the f_ep
clear and hlist_del_rcu(), the invariant is re-established for the
right reason: anyone who might clear f_ep holds @file alive for
the duration, so a NULL observation really does mean no
concurrent eventpoll path has work left on this file. Refresh the
comment accordingly so the next reader doesn't inherit the broken
model.

Link: https://patch.msgid.link/20260423-work-epoll-uaf-v1-8-2470f9eec0f5@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
include/linux/eventpoll.h