{"id":79053,"date":"2026-05-30T16:46:21","date_gmt":"2026-05-30T13:16:21","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2026-46242-eventpoll-fix-ep_remove-struct-eventpoll-struct-file-uaf\/"},"modified":"2026-05-30T16:46:21","modified_gmt":"2026-05-30T13:16:21","slug":"cve-2026-46242-eventpoll-fix-ep_remove-struct-eventpoll-struct-file-uaf","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2026-46242-eventpoll-fix-ep_remove-struct-eventpoll-struct-file-uaf\/","title":{"rendered":"CVE-2026-46242 &#8211; eventpoll: fix ep_remove struct eventpoll \/ struct file UAF"},"content":{"rendered":"<p>CVE ID :CVE-2026-46242<\/p>\n<p>  Published : May 30, 2026, 1:16 p.m. | 1\u00a0hour, 16\u00a0minutes ago<\/p>\n<p>  Description :In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>eventpoll: fix ep_remove struct eventpoll \/ struct file UAF<\/p>\n<p>ep_remove() (via ep_remove_file()) cleared file-&gt;f_ep under<br \/>\nfile-&gt;f_lock but then kept using @file inside the critical section<br \/>\n(is_file_epoll(), hlist_del_rcu() through the head, spin_unlock).<br \/>\nA concurrent __fput() taking the eventpoll_release() fastpath in<br \/>\nthat window observed the transient NULL, skipped<br \/>\neventpoll_release_file() and ran to f_op-&gt;release \/ file_free().<\/p>\n<p>For the epoll-watches-epoll case, f_op-&gt;release is<br \/>\nep_eventpoll_release() -&gt; ep_clear_and_put() -&gt; ep_free(), which<br \/>\nkfree()s the watched struct eventpoll. Its embedded -&gt;refs<br \/>\nhlist_head is exactly where epi-&gt;fllink.pprev points, so the<br \/>\nsubsequent hlist_del_rcu()&#8217;s &#8220;*pprev = next&#8221; scribbles into freed<br \/>\nkmalloc-192 memory.<\/p>\n<p>In addition, struct file is SLAB_TYPESAFE_BY_RCU, so the slot<br \/>\nbacking @file could be recycled by alloc_empty_file() &#8212;<br \/>\nreinitializing f_lock and f_ep &#8212; while ep_remove() is still<br \/>\nnominally inside that lock. The upshot is an attacker-controllable<br \/>\nkmem_cache_free() against the wrong slab cache.<\/p>\n<p>Pin @file via epi_fget() at the top of ep_remove() and gate the<br \/>\ncritical section on the pin succeeding. With the pin held @file<br \/>\ncannot reach refcount zero, which holds __fput() off and<br \/>\ntransitively keeps the watched struct eventpoll alive across the<br \/>\nhlist_del_rcu() and the f_lock use, closing both UAFs.<\/p>\n<p>If the pin fails @file has already reached refcount zero and its<br \/>\n__fput() is in flight. Because we bailed before clearing f_ep,<br \/>\nthat path takes the eventpoll_release() slow path into<br \/>\neventpoll_release_file() and blocks on ep-&gt;mtx until the waiter<br \/>\nside&#8217;s ep_clear_and_put() drops it. The bailed epi&#8217;s share of<br \/>\nep-&gt;refcount stays intact, so the trailing ep_refcount_dec_and_test()<br \/>\nin ep_clear_and_put() cannot free the eventpoll out from under<br \/>\neventpoll_release_file(); the orphaned epi is then cleaned up<br \/>\nthere.<\/p>\n<p>A successful pin also proves we are not racing<br \/>\neventpoll_release_file() on this epi, so drop the now-redundant<br \/>\nre-check of epi-&gt;dying under f_lock. The cheap lockless<br \/>\nREAD_ONCE(epi-&gt;dying) fast-path bailout stays.<\/p>\n<p>  Severity: 0.0 | NA<\/p>\n<p>  Visit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID :CVE-2026-46242 Published : May 30, 2026, 1:16 p.m. | 1\u00a0hour, 16\u00a0minutes ago Description :In the Linux kernel, the following vulnerability has been resolved: eventpoll: fix ep_remove struct eventpoll \/ struct file UAF ep_remove() (via ep_remove_file()) cleared file-&gt;f_ep under file-&gt;f_lock but then kept using @file inside the critical section (is_file_epoll(), hlist_del_rcu() through the head, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-79053","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/79053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=79053"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/79053\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=79053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=79053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=79053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}