# CVE-2025-71159: btrfs: fix use-after-free warning in btrfs\_get\_or\_create\_delayed\_node()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.44% (percentile 30, 2026-11-28)
- **CWE:** CWE-416
- **Published:** 2026-01-23T15:23:57.824Z
- **Modified:** 2026-08-05T12:12:25.188Z

## Who should check

- Anyone running Linux \>= e8513c012de75fd65e2df5499572bc6ef3f6e409, \< c8385851a5435f4006281828d428e5d0b0bbf8af; \>= e8513c012de75fd65e2df5499572bc6ef3f6e409, \< 83f59076a1ae6f5c6845d6f7ed3a1a373d883684
- Anyone running Linux 6.18

## Description

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.

## Affected and fixed versions

- Linux: \>= e8513c012de75fd65e2df5499572bc6ef3f6e409, \< c8385851a5435f4006281828d428e5d0b0bbf8af; \>= e8513c012de75fd65e2df5499572bc6ef3f6e409, \< 83f59076a1ae6f5c6845d6f7ed3a1a373d883684 (cvelist)
- Linux: 6.18 (cvelist)

## Mitigation

- Upgrade Linux to 83f59076a1ae6f5c6845d6f7ed3a1a373d883684 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-71159. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-71159.md
Affected: Linux >= e8513c012de75fd65e2df5499572bc6ef3f6e409, < c8385851a5435f4006281828d428e5d0b0bbf8af; >= e8513c012de75fd65e2df5499572bc6ef3f6e409, < 83f59076a1ae6f5c6845d6f7ed3a1a373d883684; Linux 6.18
Fixed in: Linux 83f59076a1ae6f5c6845d6f7ed3a1a373d883684

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-71159 being exploited?

There is no confirmed exploitation: CVE-2025-71159 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.44% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2025-71159?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2025-71159?

Linux \>= e8513c012de75fd65e2df5499572bc6ef3f6e409, \< c8385851a5435f4006281828d428e5d0b0bbf8af; \>= e8513c012de75fd65e2df5499572bc6ef3f6e409, \< 83f59076a1ae6f5c6845d6f7ed3a1a373d883684; Linux 6.18.

### Is there a fix for CVE-2025-71159?

Yes. Fixed in Linux 83f59076a1ae6f5c6845d6f7ed3a1a373d883684. Upgrade Linux to 83f59076a1ae6f5c6845d6f7ed3a1a373d883684 or later.

### How do I check if I'm affected by CVE-2025-71159?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/c8385851a5435f4006281828d428e5d0b0bbf8af>
- patch: <https://git.kernel.org/stable/c/83f59076a1ae6f5c6845d6f7ed3a1a373d883684>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-71159>

HTML: <https://flawdb.com/CVE-2025-71159> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-71159>
