CVE-2025-40101
Description
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix memory leaks when rejecting a non SINGLE data profile without an RST
At the end of btrfs_load_block_group_zone_info() the first thing we do is to ensure that if the mapping type is not a SINGLE one and there is no RAID stripe tree, then we return early with an error.
Doing that, though, prevents the code from running the last calls from this function which are about freeing memory allocated during its run. Hence, in this case, instead of returning early, we set the ret value and fall through the rest of the cleanup code.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Btrfs in Linux kernel fails to free memory on early error return for non-SINGLE data profile without a RAID stripe tree, causing a memory leak.
Root
Cause In the Linux kernel's btrfs filesystem, the function btrfs_load_block_group_zone_info() performs zone information loading for block groups. At the end of this function, a check is made to ensure that if the mapping type is not a SINGLE profile and there is no RAID stripe tree (RST) present, the function returns early with an error [1]. However, this early return path bypasses the cleanup code that frees memory allocated earlier in the function, leading to a memory leak [1].
Exploitation
An attacker with the ability to trigger the loading of a block group zone info with a non-SINGLE data profile on a btrfs filesystem that lacks a RAID stripe tree can cause the kernel to leak memory. This requires local access to the system and the ability to manipulate btrfs volume profiles (e.g., by mounting or resizing a filesystem). No authentication beyond normal user access is needed, as the attacker may be able to trigger the condition through filesystem operations.
Impact
The vulnerability results in kernel memory leaks over time. Repeatedly triggering the bug could exhaust system memory, potentially leading to denial of service (DoS). This is a kernel-level vulnerability that affects overall system stability and availability.
Mitigation
The fix has been included in the Linux kernel stable tree as commit 187333e6d484c6630286bfdd07c79d6815a63887 [1]. Users should apply the latest stable kernel updates to resolve the issue. No workarounds other than avoiding non-SINGLE profiles without an RST are available, which is not possible in all configurations.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
3187333e6d484602701d00439fec9b9d3ced3Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.