CVE-2025-71159

Source
https://cve.org/CVERecord?id=CVE-2025-71159
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-71159.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-71159
Downstream
Published
2026-01-23T15:23:57.824Z
Modified
2026-03-13T04:06:20.548205Z
Summary
btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()
Details

In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix use-after-free warning in btrfsgetorcreatedelayed_node()

Previously, btrfsgetorcreatedelayednode() set the delayednode's refcount before acquiring the root->delayednodes lock. Commit e8513c012de7 ("btrfs: implement reftracker for delayednodes") moved refcountset inside the critical section, which means there is no longer a memory barrier between setting the refcount and setting btrfsinode->delayednode.

Without that barrier, the stores to node->refs and btrfsinode->delayednode may become visible out of order. Another thread can then read btrfsinode->delayednode 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 GFPNOFS instead of GFPATOMIC.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/71xxx/CVE-2025-71159.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e8513c012de75fd65e2df5499572bc6ef3f6e409
Fixed
c8385851a5435f4006281828d428e5d0b0bbf8af
Fixed
83f59076a1ae6f5c6845d6f7ed3a1a373d883684

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-71159.json"