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 btrfsgetorcreatedelayednode()
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 refcountset 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.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-71159?
CVE-2025-71159 has been classified as a moderate severity vulnerability.
How do I fix CVE-2025-71159?
To fix CVE-2025-71159, update your Linux kernel to the latest version that includes the patch.
What systems are affected by CVE-2025-71159?
CVE-2025-71159 affects the Linux kernel, particularly versions that include the btrfs filesystem.
What are the potential impacts of CVE-2025-71159?
The potential impacts of CVE-2025-71159 include system instability and exploitation leading to privilege escalation.
Who is affected by CVE-2025-71159?
Users of Linux systems utilizing the btrfs filesystem are affected by CVE-2025-71159.