Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

eventpoll: use hlist_is_singular_node() in __ep_remove()

Replace the open-coded "epi is the only entry in file->f_ep" check
with hlist_is_singular_node(). Same semantics, and the helper avoids
the head-cacheline access in the common false case.

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

+1 -1
+1 -1
fs/eventpoll.c
··· 856 856 857 857 to_free = NULL; 858 858 head = file->f_ep; 859 - if (head->first == &epi->fllink && !epi->fllink.next) { 859 + if (hlist_is_singular_node(&epi->fllink, head)) { 860 860 /* See eventpoll_release() for details. */ 861 861 WRITE_ONCE(file->f_ep, NULL); 862 862 if (!is_file_epoll(file)) {