CVE-2025-71269: btrfs: do not free data reservation in fallback from inline due to -ENOSPC
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
btrfs: do not free data reservation in fallback from inline due to -ENOSPC
If we fail to create an inline extent due to -ENOSPC, we will attempt to go through the normal COW path, reserve an extent, create an ordered extent, etc. However we were always freeing the reserved qgroup data, which is wrong since we will use data. Fix this by freeing the reserved qgroup data in __cow_file_range_inline() only if we are not doing the fallback (ret is <= 0).
The Linux kernel CVE team has assigned CVE-2025-71269 to this issue.
Affected and fixed versions
===========================
Fixed in 6.18.10 with commit 6de3a371a8b9fd095198b1aa68c22cc10a4c6961 Fixed in 6.19 with commit f8da41de0bff9eb1d774a7253da0c9f637c4470a
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2025-71269
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/btrfs/inode.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/6de3a371a8b9fd095198b1aa68c22cc10a4c6961 https://git.kernel.org/stable/c/f8da41de0bff9eb1d774a7253da0c9f637c4470a