projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a46638
)
eventpoll: use hlist_is_singular_node() in __ep_remove()
author
Christian Brauner
<brauner@kernel.org>
Thu, 23 Apr 2026 09:56:04 +0000
(11:56 +0200)
committer
Christian Brauner
<brauner@kernel.org>
Thu, 23 Apr 2026 22:35:41 +0000
(
00:35
+0200)
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>
fs/eventpoll.c
patch
|
blob
|
history
diff --git
a/fs/eventpoll.c
b/fs/eventpoll.c
index
23f3c6a
..
4e84409
100644
(file)
--- a/
fs/eventpoll.c
+++ b/
fs/eventpoll.c
@@
-856,7
+856,7
@@
static bool __ep_remove(struct eventpoll *ep, struct epitem *epi, bool force)
to_free = NULL;
head = file->f_ep;
- if (h
ead->first == &epi->fllink && !epi->fllink.next
) {
+ if (h
list_is_singular_node(&epi->fllink, head)
) {
/* See eventpoll_release() for details. */
WRITE_ONCE(file->f_ep, NULL);
if (!is_file_epoll(file)) {