]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
eventpoll: move f_lock acquisition into ep_remove_file()
authorChristian Brauner <brauner@kernel.org>
Thu, 23 Apr 2026 09:56:10 +0000 (11:56 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 23 Apr 2026 22:36:37 +0000 (00:36 +0200)
commitd30deeb8b0cf6259785c1fb79b87905d281b0a5a
tree7890a5d6635ace9c4354f6b6eaaf6fa937322a3c
parenta6dc643c69311677c574a0f17a3f4d66a5f3744b
eventpoll: move f_lock acquisition into ep_remove_file()

Let the helper own its critical section end-to-end: take &file->f_lock
at the top, read file->f_ep inside the lock, release on exit. Callers
(ep_remove() and eventpoll_release_file()) no longer need to wrap the
call, and the function-comment lock-handoff contract is gone.

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