CVE-2025-71159: btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()
Previously, btrfs_get_or_create_delayed_node() set the delayed_node's
refcount before acquiring the root->delayed_nodes lock.
Commit e8513c012de7 ("btrfs: implement ref_tracker for delayed_nodes")
moved refcount_set inside the critical section, which means there is
no longer a memory barrier between setting the refcount and setting
btrfs_inode->delayed_node.
Without that barrier, the stores to node->refs and
btrfs_inode->delayed_node may become visible out of order. Another
thread can then read btrfs_inode->delayed_node and attempt to
increment a refcount that hasn't been set yet, leading to a
refcounting bug and a use-after-free warning.
The fix is to move refcount_set back to where it was to take
advantage of the implicit memory barrier provided by lock
acquisition.
Because the allocations now happen outside of the lock's critical
section, they can use GFP_NOFS instead of GFP_ATOMIC.
Security readout for executives and security teams
Plain-English summary
A Linux Btrfs concurrency flaw can expose already-freed kernel memory when two threads observe initialization in different orders. Affected systems may experience kernel instability and potentially broader security impact. The supplied rating is critical, but the sources do not demonstrate remote reachability or successful exploitation.
Executive priority
Treat as an urgent kernel maintenance issue on Btrfs-enabled systems, especially shared or exposed infrastructure. Validate actual exposure before assuming the network-scored worst case. Expedite vendor-fixed kernels, while recognizing that the provided evidence does not establish active exploitation.
Technical view
A missing ordering barrier in btrfs_get_or_create_delayed_node() can expose btrfs_inode->delayed_node before node->refs is initialized. Another thread may increment an unset reference count, causing faulty lifetime management and a use-after-free warning. The correction restores refcount_set before lock acquisition, using the lock’s implicit memory barrier.
Likely exposure
Exposure is limited to Linux systems running the listed affected kernel versions and using Btrfs code paths. The bundle identifies versions around 6.18 through 6.19, but its version data is ambiguous and should be confirmed against distribution advisories and kernel commit ancestry.
Exploitation context
The supplied CVSS is 9.8 with a network attack vector. However, the technical sources describe an internal Btrfs race and do not explain a remotely reachable trigger. The CVE is not listed as KEV in the bundle, and no cited source reports active exploitation or a public exploit.
Researcher notes
The central condition is a store-ordering race introduced after refcount initialization moved inside root->delayed_nodes locking. The fix restores initialization ordering and permits GFP_NOFS allocations outside the critical section. Precise vulnerable release boundaries, trigger reliability, and security impact beyond the warning are not fully established by the supplied sources.
Mitigation direction
Install a vendor-supported kernel containing one of the referenced stable fixes.
Check distribution advisories for exact fixed package versions and reboot requirements.
Prioritize hosts using Btrfs or processing storage activity from less-trusted workloads.
Use vendor-recommended operational mitigations if immediate kernel replacement is unavailable.
Validation and detection
Record running kernel versions and identify systems with mounted Btrfs filesystems.
Compare kernel packages and commit ancestry with the referenced stable fixes.
Confirm updated systems booted into the fixed kernel, not an older installed kernel.
Review kernel logs for Btrfs refcount, use-after-free, or related memory-safety warnings.
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-71159 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
0ADP providers
3Source links
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.