CVE-2025-21879·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix use-after-free on inode when scanning root during em shrinking At btrfs_scan_root() we are accessing the inode's root (and fs_info) in a call to btrfs_fs_closing() 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 btrfs_fs_closing(). Fix this by using the fs_info stored already in a local variable instead of doing inode->root->fs_info.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.13.6
- Published
- 2025-03-27
Affected versions
From: 6.13
Until: 6.13.6
Fixed in: 6.13.6
How to fix this CVE
Update your Linux kernel to version 6.13.6 or later to resolve this use-after-free vulnerability in the btrfs filesystem. The vulnerability occurs when the kernel accesses freed inode memory during root scanning operations. Systems running kernel versions 6.13 through 6.13.5 should prioritize this update to prevent potential system instability or memory corruption.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Run `uname -r` to display the currently running kernel version and compare against the vulnerable range 6.13 through 6.13.5
- Check if btrfs filesystems are in use by running `df -t btrfs` or `mount | grep btrfs` to determine if the affected code path is active
- Search system logs for btrfs-related errors using `grep -i 'use.after.free\|use-after-free\|btrfs.*error' /var/log/kern.log /var/log/messages 2>/dev/null`
- Verify the kernel has been updated by rebooting the system and confirming `uname -r` returns version 6.13.6 or later
FAQ
What is CVE-2025-21879?
CVE-2025-21879 is a use-after-free vulnerability in the Linux kernel's btrfs filesystem code where the kernel accesses an inode after it has been scheduled for deferred cleanup, potentially leading to memory corruption or system crashes.
Is CVE-2025-21879 being actively exploited?
No, CVE-2025-21879 is not currently listed on the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available. However, the high CVSS score of 7.8 warrants prompt patching.
What versions of Kernel are affected by CVE-2025-21879?
Kernel versions 6.13 through 6.13.5 are affected. Version 6.13.6 and later contain the fix.
How do I check if my server is vulnerable to CVE-2025-21879?
Run `uname -r` and if the output shows a kernel version in the 6.13.x range before 6.13.6, your system is vulnerable. Additionally verify btrfs is in use with `mount | grep btrfs`.
Does Defensia detect CVE-2025-21879?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2025-21879 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2025-21879. Free for 1 server.
Get started free