CVE-2025-38349: eventpoll: don't decrement ep refcount while still holding the ep mutex
In the Linux kernel, the following vulnerability has been resolved:
eventpoll: don't decrement ep refcount while still holding the ep mutex
Jann Horn points out that epoll is decrementing the ep refcount and then
doing a
mutex_unlock(&ep->mtx);
afterwards. That's very wrong, because it can lead to a use-after-free.
That pattern is actually fine for the very last reference, because the
code in question will delay the actual call to "ep_free(ep)" until after
it has unlocked the mutex.
But it's wrong for the much subtler "next to last" case when somebody
*else* may also be dropping their reference and free the ep while we're
still using the mutex.
Note that this is true even if that other user is also using the same ep
mutex: mutexes, unlike spinlocks, can not be used for object ownership,
even if they guarantee mutual exclusion.
A mutex "unlock" operation is not atomic, and as one user is still
accessing the mutex as part of unlocking it, another user can come in
and get the now released mutex and free the data structure while the
first user is still cleaning up.
See our mutex documentation in Documentation/locking/mutex-design.rst,
in particular the section [1] about semantics:
"mutex_unlock() may access the mutex structure even after it has
internally released the lock already - so it's not safe for
another context to acquire the mutex and assume that the
mutex_unlock() context is not using the structure anymore"
So if we drop our ep ref before the mutex unlock, but we weren't the
last one, we may then unlock the mutex, another user comes in, drops
_their_ reference and releases the 'ep' as it now has no users - all
while the mutex_unlock() is still accessing it.
Fix this by simply moving the ep refcount dropping to outside the mutex:
the refcount itself is atomic, and doesn't need mutex protection (that's
the whole _point_ of refcounts: unlike mutexes, they are inherently
about object lifetimes).
Security readout for executives and security teams
Plain-English summary
A Linux kernel race can free an epoll object while the kernel is still using its mutex. A local, low-privileged user may trigger memory corruption, potentially compromising confidentiality, integrity, and availability. The source assigns CVSS 7.8 and high severity.
Executive priority
Prioritize remediation on multi-user or otherwise locally accessible Linux systems. The flaw requires local privileges, reducing immediate remote risk, but successful exploitation could provide broad system impact. Schedule prompt kernel updates and verify reboot completion; accelerate handling where untrusted users have local execution capability.
Technical view
The eventpoll code dropped an epoll reference before completing mutex_unlock(). In the next-to-last reference case, another context could acquire the mutex, release the final reference, and free the object while the original unlock operation still accessed it. The fix moves the atomic reference decrement after the mutex unlock.
Likely exposure
Exposure is limited to Linux kernels identified as affected in the CVE record. Exploitation requires local access with low privileges; it is not described as remotely reachable. Exact exposure should be established from the running kernel build and vendor backport status, because version data includes commit identifiers and release numbers.
Exploitation context
The supplied record does not establish active exploitation, and the CVE is not listed as KEV. A Project Zero issue is referenced, but the bundle does not state that a public exploit exists or that exploitation has occurred. Treat practical exploitability as unconfirmed.
Researcher notes
The defect is an object-lifetime race involving epoll reference counting and mutex teardown semantics. The source describes a use-after-free window but provides no confirmed exploit reliability, attack observations, or affected configuration prerequisites beyond local low-privileged access. Version assessment should account for distribution backports.
Mitigation direction
Update to a vendor-supported kernel containing the referenced eventpoll fix.
Check distribution advisories for backported fixes before relying only on version numbers.
Restrict unnecessary local account access until affected kernels are remediated.
Prioritize shared systems where untrusted users can execute local programs.
Validation and detection
Inventory running kernel versions and exact distribution build identifiers.
Compare each build against vendor advisories and the referenced stable-kernel fixes.
Confirm the installed kernel contains the reference-drop ordering correction.
Reboot updated systems and verify the remediated kernel is running.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-38349 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
7Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.