Linux: btrfs: fix reloc root cleanup in merge_reloc_roots()
What fixes it
- 29531470b1bf1e8bd2df4941fe913106edbca615LinuxCVE List
- 415f8665a969d3c906e4fd7c90fcbb4b357886f6LinuxCVE List
- 0bc25f0a2d1b3e0a691431c4d7aef36afcd527c5LinuxCVE List
- 63d6b1f04cd91c825329712aa526215ffa5d11caLinuxCVE List
- 5.5LinuxCVE List
- 5.8LinuxCVE List
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
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.
Text from CVE List
Affected versions 20
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before 29531470b1bf1e8bd2df4941fe913106edbca615CVE List
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before 415f8665a969d3c906e4fd7c90fcbb4b357886f6CVE List
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before ee695a968aa73b1e67ccbf2133dc0e54381d32b2CVE List
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before 0bc25f0a2d1b3e0a691431c4d7aef36afcd527c5CVE List
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before ab48583aa9948205ff9a6470e23dbff74c565e24CVE List
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before 63d6b1f04cd91c825329712aa526215ffa5d11caCVE List
- Linuxaffected: 1dae7e0e58b484eaa43d530f211098fdeeb0f404 before b78fe9563e2d5ae47805f1e5dc722c91fd30e1f8CVE List
- Linuxaffected: ee08663380ffd5a45a1c87580fbc305e8413c235CVE List
- Linuxaffected: 33823378ff2b510fd7b566f25bb18438aeb9b23bCVE List
- Linuxaffected: 5.4.54 before 5.5CVE List
- Linuxaffected: 5.7.11 before 5.8CVE List
- Linuxaffected: 5.8CVE List
- Linuxunaffected: all versions before 5.8CVE List
- Linuxunaffected: 5.10.271 through 5.10.*CVE List
- Linuxunaffected: 5.15.222 through 5.15.*CVE List
- Linuxunaffected: 6.1.189 through 6.1.*CVE List
- Linuxunaffected: 6.6.158 through 6.6.*CVE List
- Linuxunaffected: 6.12.111 through 6.12.*CVE List
- Linuxunaffected: 6.18.53 through 6.18.*CVE List
- Linuxunaffected: 7.2CVE List
References 7
- git.kernel.org/stable/c/29531470b1bf1e8bd2df4941fe913106edbca615Referencevia CVE List
- git.kernel.org/stable/c/415f8665a969d3c906e4fd7c90fcbb4b357886f6Referencevia CVE List
- git.kernel.org/stable/c/ee695a968aa73b1e67ccbf2133dc0e54381d32b2Referencevia CVE List
- git.kernel.org/stable/c/0bc25f0a2d1b3e0a691431c4d7aef36afcd527c5Referencevia CVE List
- git.kernel.org/stable/c/ab48583aa9948205ff9a6470e23dbff74c565e24Referencevia CVE List
- git.kernel.org/stable/c/63d6b1f04cd91c825329712aa526215ffa5d11caReferencevia CVE List
- git.kernel.org/stable/c/b78fe9563e2d5ae47805f1e5dc722c91fd30e1f8Referencevia CVE List