CyberSecBulletin
CVE-2025-38349NVD status: Modified

Linux: Use After Free

CVE-2025-38349 is a high-severity use after free vulnerability in Linux, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. The record lists versions 263f5de8302a6f2f136d392e5d3f8b1edf922857, b0821ec902d39062356cb644c16e17a705d1c9f5, 521e9ff0b67c66a17d6f9593dfccafaa984aae4c as the first without the flaw, so updating Linux to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.18% chance of exploitation within 30 days, which is low compared with other CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update Linux to 263f5de8302a6f2f136d392e5d3f8b1edf922857 or b0821ec902d39062356cb644c16e17a705d1c9f5 or 521e9ff0b67c66a17d6f9593dfccafaa984aae4c or 6dee745bd0aec9d399df674256e7b1ecdb615444, whichever matches your release line, or a later version.
  2. Update Linux Kernel to 6.6.99 or 6.12.39 or 6.15.7, whichever matches your release line, or a later version.

Affected products and versions

VendorProductAffected versionsFixed in
LinuxLinuxf2451def095c1743adcfcb0cb5dadc86034e162a up to, but not including, 263f5de8302a6f2f136d392e5d3f8b1edf922857; a1f93804449d13f97dabd4b996817de4bf1ed67a up to, but not including, b0821ec902d39062356cb644c16e17a705d1c9f5; 58c9b016e12855286370dfb704c08498edbc857a up to, but not including, 521e9ff0b67c66a17d6f9593dfccafaa984aae4c; 58c9b016e12855286370dfb704c08498edbc857a up to, but not including, 6dee745bd0aec9d399df674256e7b1ecdb615444; 58c9b016e12855286370dfb704c08498edbc857a up to, but not including, 605c18698ecfa99165f36b7f59d3ed503e169814; 58c9b016e12855286370dfb704c08498edbc857a up to, but not including, 8c2e52ebbe885c7eeaabd3b7ddcdc1246fc400d2; 5.15.209 up to, but not including, 5.15.222; 6.1.175 up to, but not including, 6.1.178; and 1 more ranges263f5de8302a6f2f136d392e5d3f8b1edf922857, b0821ec902d39062356cb644c16e17a705d1c9f5, 521e9ff0b67c66a17d6f9593dfccafaa984aae4c, 6dee745bd0aec9d399df674256e7b1ecdb615444, 605c18698ecfa99165f36b7f59d3ed503e169814, 8c2e52ebbe885c7eeaabd3b7ddcdc1246fc400d2
LinuxLinux Kernel6.4 up to, but not including, 6.6.99; 6.7 up to, but not including, 6.12.39; 6.13 up to, but not including, 6.15.7; 6.166.6.99, 6.12.39, 6.15.7

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
LocalThe attacker needs local access or must trick a user into running something.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.17.8HighCNA
CVSS 3.17.8HighNVD

Official description

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).

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use After Free

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.

How developers prevent this class of flaw

  • Choose a language that provides automatic memory management.
  • When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.

More Use After Free vulnerabilities (CWE-416)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Recent Use After Free vulnerabilities

Spotted an error? Tell us.