CVE-2025-21879: btrfs: fix use-after-free on inode when scanning root during em shrinking
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix use-after-free on inode when scanning root during em shrinking
At btrfsscanroot() we are accessing the inode's root (and fsinfo) in a call to btrfsfsclosing() after we have scheduled the inode for a delayed iput, and that can result in a use-after-free on the inode in case the cleaner kthread does the iput before we dereference the inode in the call to btrfsfsclosing().
Fix this by using the fsinfo stored already in a local variable instead of doing inode->root->fsinfo.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-21879?
CVE-2025-21879 has not been assigned a specific CVSS score yet, but it is considered a critical vulnerability due to the potential for a use-after-free condition.
How do I fix CVE-2025-21879?
To fix CVE-2025-21879, upgrade to a patched version of the Linux kernel that addresses this vulnerability.
What versions of Linux Kernel are affected by CVE-2025-21879?
CVE-2025-21879 affects Linux Kernel versions from 6.13 up to 6.14-rc4.
What are the symptoms of CVE-2025-21879 exploitation?
Exploitation of CVE-2025-21879 may lead to system instability, crashes, or unauthorized access due to the use-after-free error.
Is there a workaround for CVE-2025-21879?
There is no known workaround for CVE-2025-21879; upgrading the kernel is the recommended solution.