CVE-2025-39800: btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
btrfs: abort transaction on unexpected eb generation at btrfs_copy_root()
If we find an unexpected generation for the extent buffer we are cloning at btrfs_copy_root(), we just WARN_ON() and don't error out and abort the transaction, meaning we allow to persist metadata with an unexpected generation. Instead of warning only, abort the transaction and return -EUCLEAN.
The Linux kernel CVE team has assigned CVE-2025-39800 to this issue.
Affected and fixed versions
===========================
Fixed in 6.1.149 with commit 4290e34fb87ae556b12c216efd0ae91583446b7a Fixed in 6.6.103 with commit 4734255ef39b416864139dcda96a387fe5f33a6a Fixed in 6.12.44 with commit da2124719f386b6e5d4d4b1a2e67c440e4d5892f Fixed in 6.16.4 with commit f4f5bd9251a4cbe55aaa05725c6c3c32ad1f74b3 Fixed in 6.17-rc1 with commit 33e8f24b52d2796b8cfb28c19a1a7dd6476323a8
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-39800
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/ctree.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/4290e34fb87ae556b12c216efd0ae91583446b7a https://git.kernel.org/stable/c/4734255ef39b416864139dcda96a387fe5f33a6a https://git.kernel.org/stable/c/da2124719f386b6e5d4d4b1a2e67c440e4d5892f https://git.kernel.org/stable/c/f4f5bd9251a4cbe55aaa05725c6c3c32ad1f74b3 https://git.kernel.org/stable/c/33e8f24b52d2796b8cfb28c19a1a7dd6476323a8