Kernel NULL Pointer Dereference Vulnerability in Linux Btrfs Package
Summary
CVE-2025-21658: In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid NULL pointer dereference if no valid extent tree [BUG] Syzbot reported a crash with the following call trace: BTRFS info (device loop0): sc... Affects linux versions 6.1.106-1 – 6.9.9-1. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Linux kernel is the core component of the Linux operating system, managing hardware resources and providing essential services to software applications. Btrfs (B-tree file system) is a modern file system for Linux that offers advanced features such as snapshots, dynamic inode allocation, and integrated volume management. This vulnerability affects the Btrfs file system, specifically during the scrub operation, which is designed to check the integrity of data and metadata stored on the file system.
Vulnerability Detail
The vulnerability, identified as CVE-2025-21658, arises from a NULL pointer dereference in the Btrfs scrub functionality. When a corrupted image is mounted with the 'rescue=all,ro' option, the scrub operation attempts to access the extent tree, which may be NULL due to corruption. This leads to a crash in the kernel, as the scrub function does not handle the case where the extent root is NULL, resulting in a potential denial of service. The issue was reported by Syzbot and affects kernel versions prior to 6.6.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, avoid using the 'rescue=all,ro' mount option on potentially corrupted Btrfs file systems to prevent triggering the scrub operation that leads to the NULL pointer dereference.
Conclusion
CVE-2025-21658 is a critical vulnerability in the Linux kernel's Btrfs file system that can lead to a kernel crash due to a NULL pointer dereference during scrub operations. Users are advised to update their systems to kernel version 6.6 or later to mitigate this issue. Temporary workarounds are available, but the best course of action is to apply the patch.
See every vulnerability recorded for linux →
FAQ
CVE-2025-21658 is a vulnerability in the Linux kernel's Btrfs file system that can lead to a kernel crash due to a NULL pointer dereference during scrub operations.
If you are using a version of the Linux kernel prior to 6.6 and utilize Btrfs, especially with corrupted file systems, your system may be affected.
Exploiting this vulnerability can lead to a denial of service, causing the kernel to crash and potentially resulting in data loss or system instability.
Yes, a patch is available in kernel versions 6.6 and later. Updating to these versions will resolve the vulnerability.
Yes, Vulert can monitor your software for open-source vulnerabilities in real-time using a manifest file like package-lock.json. You can also check if your application is affected by this vulnerability using the Vulert playground without any signup.
Related vulnerabilities
Recent vulnerabilities recorded for linux.