In the Linux kernel, the following vulnerability has been resolved:
btrfs: set BTRFS_ROOT_ORPHAN_CLEANUP during subvol create
We have recently observed a number of subvolumes with broken dentries. ls-ing the parent dir looks like:
drwxrwxrwt 1 root root 16 Jan 23 16:49 . drwxr-xr-x 1 root root 24 Jan 23 16:48 .. d????????? ? ? ? ? ? broken_subvol
and similarly stat-ing the file fails.
In this state, deleting the subvol fails with ENOENT, but attempting to create a new file or subvol over it errors out with EEXIST and even aborts the fs. Which leaves us a bit stuck.
dmesg contains a single notable error message reading: "could not do orphan cleanup -2"
2 is ENOENT and the error comes from the failure handling path of btrfs_orphan_cleanup(), with the stack leading back up to btrfs_lookup().
btrfs_lookup btrfs_lookup_dentry btrfs_orphan_cleanup // prints that message and returns -ENOENT
After some detailed inspection of the internal state, it became clear that: - there are no orphan items for the subvol - the subvol is otherwise healthy looking, it is not half-deleted or anything, there is no drop progress, etc. - the subvol was created a while ago and does the meaningful first btrfs_orphan_cleanup() call that sets BTRFS_ROOT_ORPHAN_CLEANUP much later. - after btrfs_orphan_cleanup() fails, btrfs_lookup_dentry() returns -ENOENT, which results in a negative dentry for the subvolume via d_splice_alias(NULL, dentry), leading to the observed behavior. The bug can be mitigated by dropping the dentry cache, at which point we can successfully delete the subvolume if we want.
i.e., btrfs_lookup() btrfs_lookup_dentry() if (!sb_rdonly(inode->vfs_inode)->vfs_inode) btrfs_orphan_cleanup(sub_root) test_and_set_bit(BTRFS_ROOT_ORPHAN_CLEANUP) btrfs_search_slot() // finds orphan item for inode N ... prints "could not do orphan cleanup -2" if (inode == ERR_PTR(-ENOENT)) inode = NULL; return d_splice_alias(NULL, dentry) // NEGATIVE DENTRY for valid subvolume
btrfs_orphan_cleanup() does test_and_set_bit(BTRFS_ROOT_ORPHAN_CLEANUP) on the root when it runs, so it cannot run more than once on a given root, so something else must run concurrently. However, the obvious routes to deleting an orphan when nlinks goes to 0 should not be able to run without first doing a lookup into the subvolume, which should run btrfs_orphan_cleanup() and set the bit.
The final important observation is that create_subvol() calls d_instantiate_new() but does not set BTRFS_ROOT_ORPHAN_CLEANUP, so if the dentry cache gets dropped, the next lookup into the subvolume will make a real call into btrfs_orphan_cleanup() for the first time. This opens up the possibility of concurrently deleting the inode/orphan items but most typical evict() paths will be holding a reference on the parent dentry (child dentry holds parent->d_lockref.count via dget in d_alloc(), released in __dentry_kill()) and prevent the parent from being removed from the dentry cache.
The one exception is delayed iputs. Ordered extent creation calls igrab() on the inode. If the file is unlinked and closed while those refs are held, iput() in __dentry_kill() decrements i_count but does not trigger eviction (i_count > 0). The child dentry is freed and the subvol dentry's d_lockref.count drops to 0, making it evictable while the inode is still alive.
Since there are two races (the race between writeback and unlink and the race between lookup and delayed iputs), and there are too many moving parts, the following three diagrams show the complete picture. (Only the second and third are races)
Phase 1: Create Subvol in dentry cache without BTRFS_ROOT_ORPHAN_CLEANUP set
btrfs_mksubvol() lookup_one_len() __lookup_slow() d_alloc_parallel() __d_alloc() // d_lockref.count = 1 create_subvol(dentry) // doesn't touch the bit.. d_instantiate_new(dentry, inode) // dentry in cache with d_lockref.c ---truncated---
CVSS Details
- CVSS 3.1 Base Score: 5.5
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon_linux_2023 | — | Upgrade kernel-tools-develUpgrade kernel6.18-headersUpgrade kernel6.12-debuginfoUpgrade kernel-livepatch-6.12.80-105.147Upgrade bpftoolUpgrade perf-debuginfoUpgrade perfUpgrade kernel6.18-toolsUpgrade kernel6.18-modules-extra-commonUpgrade python3-perf6.12Upgrade kernel-libbpfUpgrade kernel6.12-tools-debuginfoUpgrade kernel6.18Upgrade kernel6.12-toolsUpgrade python3-perfUpgrade kernel-debuginfoUpgrade kernel-livepatch-6.1.168-202.320Upgrade kernel6.12-develUpgrade python3-perf6.12-debuginfoUpgrade bpftool6.12-debuginfoUpgrade kernel-debuginfo-common-aarch64Upgrade kernel6.18-modules-extraUpgrade kernel-modules-extraUpgrade kernel-develUpgrade kernel6.12-libbpfUpgrade python3-perf-debuginfoUpgrade kernel6.12-debuginfo-common-x86_64Upgrade kernel-tools-debuginfoUpgrade perf6.12-debuginfoUpgrade kernel6.12-modules-extra-commonUpgrade kernel6.12-libbpf-staticUpgrade kernel6.12-tools-develUpgrade kernel6.18-tools-develUpgrade kernel-livepatch-6.18.25-52.107Upgrade kernel-headersUpgrade kernel-debuginfo-common-x86_64Upgrade kernel-toolsUpgrade kernel-modules-extra-commonUpgrade bpftool6.18-debuginfoUpgrade kernelUpgrade kernel6.18-tools-debuginfoUpgrade kernel-libbpf-staticUpgrade perf6.18-debuginfoUpgrade perf6.18Upgrade perf6.12Upgrade kernel-libbpf-debuginfoUpgrade bpftool6.12Upgrade kernel-libbpf-develUpgrade python3-perf6.18-debuginfoUpgrade kernel6.12-libbpf-debuginfoUpgrade bpftool6.18Upgrade kernel6.12-modules-extraUpgrade bpftool-debuginfoUpgrade python3-perf6.18Upgrade kernel6.18-debuginfo-common-x86_64Upgrade kernel6.12-headersUpgrade kernel6.18-debuginfo-common-aarch64Upgrade kernel6.18-debuginfoUpgrade kernel6.12Upgrade kernel6.18-develUpgrade kernel6.12-debuginfo-common-aarch64Upgrade kernel6.12-libbpf-devel | May 6, 2026 | Apr 22, 2026 |
| Debian | — | Upgrade linuxUpgrade linux-6.1 | May 3, 2026 | May 3, 2026 |
| Redhat_linux | — | No solution exists | Jul 17, 2026 | Apr 22, 2026 |
| Ubuntu | — | Upgrade linux-image-intel-iot-realtimeUpgrade linux-image-realtime-6.8.1Upgrade linux-image-6.8.0-136-lowlatency-64kUpgrade linux-image-6.8.1-1056-realtimeUpgrade linux-image-genericUpgrade linux-image-6.8.0-136-fipsUpgrade linux-image-azure-fde-6.8Upgrade linux-image-gcp-6.8Upgrade linux-image-gcp-64k-6.8Upgrade linux-image-6.8.0-1030-nvidia-tegra-rtUpgrade linux-image-gke-6.8Upgrade linux-image-6.8.0-1061-awsUpgrade linux-image-nvidia-tegra-rtUpgrade linux-image-oem-20.04Upgrade linux-image-oem-20.04cUpgrade linux-image-lowlatency-64k-6.8Upgrade linux-image-oem-22.04dUpgrade linux-image-raspi-6.8Upgrade linux-image-nvidia-tegra-rt-6.8Upgrade linux-image-xilinx-6.8Upgrade linux-image-6.8.0-1061-ibmUpgrade linux-image-6.8.0-1062-azure-fdeUpgrade linux-image-intel-iotgUpgrade linux-image-raspiUpgrade linux-image-aws-lts-24.04Upgrade linux-image-nvidia-hwe-22.04Upgrade linux-image-nvidia-lowlatency-6.8Upgrade linux-image-6.8.0-1063-azureUpgrade linux-image-gcp-fips-6.8Upgrade linux-image-gkeUpgrade linux-image-nvidia-6.8Upgrade linux-image-aws-fipsUpgrade linux-image-gkeopUpgrade linux-image-virtual-hwe-22.04Upgrade linux-image-6.8.0-1061-aws-64kUpgrade linux-image-realtimeUpgrade linux-image-6.8.0-136-generic-64kUpgrade linux-image-virtual-6.8Upgrade linux-image-nvidia-lowlatency-64k-6.8Upgrade linux-image-nvidia-lowlatency-64kUpgrade linux-image-oracle-6.8Upgrade linux-image-lowlatency-hwe-22.04Upgrade linux-image-6.8.0-2050-raspi-realtimeUpgrade linux-image-aws-64kUpgrade linux-image-azureUpgrade linux-image-gke-64kUpgrade linux-image-lowlatency-64k-hwe-22.04Upgrade linux-image-gke-64k-6.8Upgrade linux-image-nvidia-lowlatencyUpgrade linux-image-gcp-64k-lts-24.04Upgrade linux-image-azure-6.8Upgrade linux-image-gcp-64kUpgrade linux-image-fipsUpgrade linux-image-6.8.0-1064-gcpUpgrade linux-image-gcp-lts-24.04Upgrade linux-image-6.8.0-1059-nvidiaUpgrade linux-image-6.8.0-1063-azure-fipsUpgrade linux-image-xilinx-zynqmpUpgrade linux-image-generic-64k-hwe-22.04Upgrade linux-image-oem-22.04Upgrade linux-image-laptop-23.10Upgrade linux-image-oracleUpgrade linux-image-nvidia-tegra-6.8Upgrade linux-image-lowlatency-6.8Upgrade linux-image-realtime-hwe-22.04Upgrade linux-image-xilinxUpgrade linux-image-awsUpgrade linux-image-gcpUpgrade linux-image-generic-64k-6.8Upgrade linux-image-raspi-realtime-6.8Upgrade linux-image-oracle-64k-6.8Upgrade linux-image-azure-fipsUpgrade linux-image-6.8.0-1058-oracleUpgrade linux-image-nvidiaUpgrade linux-image-nvidia-tegraUpgrade linux-image-generic-6.8Upgrade linux-image-6.8.0-1061-aws-fipsUpgrade linux-image-ibm-6.8Upgrade linux-image-oem-22.04bUpgrade linux-image-generic-64kUpgrade linux-image-aws-64k-6.8Upgrade linux-image-6.8.0-1064-gcp-64kUpgrade linux-image-6.8.0-136-genericUpgrade linux-image-6.8.0-1030-nvidia-tegraUpgrade linux-image-azure-fdeUpgrade linux-image-oracle-64kUpgrade linux-image-oem-22.04aUpgrade linux-image-oem-20.04dUpgrade linux-image-nvidia-64k-hwe-22.04Upgrade linux-image-kvmUpgrade linux-image-ibmUpgrade linux-image-generic-hwe-22.04Upgrade linux-image-aws-6.8Upgrade linux-image-6.8.0-1061-raspiUpgrade linux-image-6.8.0-1046-gkeopUpgrade linux-image-6.8.0-136-lowlatencyUpgrade linux-image-raspi-realtimeUpgrade linux-image-6.8.0-1058-oracle-64kUpgrade linux-image-ibm-lts-24.04Upgrade linux-image-oracle-lts-24.04Upgrade linux-image-oem-20.04bUpgrade linux-image-azure-lts-24.04Upgrade linux-image-azure-fips-6.8Upgrade linux-image-aws-fips-6.8Upgrade linux-image-ibm-classicUpgrade linux-image-gkeop-6.8Upgrade linux-image-6.8.0-1059-nvidia-lowlatencyUpgrade linux-image-6.8.0-1059-nvidia-64kUpgrade linux-image-lowlatencyUpgrade linux-image-6.8.0-1033-xilinxUpgrade linux-image-6.8.0-1059-gkeUpgrade linux-image-oracle-64k-lts-24.04Upgrade linux-image-fips-6.8Upgrade linux-image-gcp-fipsUpgrade linux-image-lowlatency-64kUpgrade linux-image-aws-64k-lts-24.04Upgrade linux-image-6.8.0-1064-gcp-fipsUpgrade linux-image-6.8.0-1059-gke-64kUpgrade linux-image-nvidia-64k-6.8Upgrade linux-image-nvidia-64kUpgrade linux-image-generic-lpaeUpgrade linux-image-azure-fde-lts-24.04Upgrade linux-image-6.8.0-1059-nvidia-lowlatency-64kUpgrade linux-image-virtualUpgrade linux-image-oem-22.04c | Jul 21, 2026 | Jul 20, 2026 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | May 27, 2026 | Apr 22, 2026 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub