CVE-2026-93798: btrfs: fix reloc root cleanup in merge_reloc_roots()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix reloc root cleanup in merge_reloc_roots()
If the root we got has zero root refs in its root item, we are resetting the root's ->reloc_root without using barriers like we do everywhere else. Sashiko complained about this while reviewing another patch, and it's correct (see the Link tag below).
Also, we should not clear BTRFS_ROOT_DEAD_RELOC_TREE from the root unless the root points to the reloc root we have.
Fix this by using clear_reloc_root(), which issues the memory barrier after setting the root's ->reloc_root to NULL and before clearing the bit BTRFS_ROOT_DEAD_RELOC_TREE from the root.
The Linux kernel CVE team has assigned CVE-2026-93798 to this issue.
Affected and fixed versions
===========================
Fixed in 6.12.111 with commit ab48583aa9948205ff9a6470e23dbff74c565e24 Fixed in 6.18.53 with commit 63d6b1f04cd91c825329712aa526215ffa5d11ca Fixed in 7.2 with commit b78fe9563e2d5ae47805f1e5dc722c91fd30e1f8
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-2026-93798
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/relocation.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/ab48583aa9948205ff9a6470e23dbff74c565e24 https://git.kernel.org/stable/c/63d6b1f04cd91c825329712aa526215ffa5d11ca https://git.kernel.org/stable/c/b78fe9563e2d5ae47805f1e5dc722c91fd30e1f8