Vulnerability · Published Apr 22, 2026 · Assigned by Linux

CVE-2026-31519btrfs: set BTRFS_ROOT_ORPHAN_CLEANUP during subvol create

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 2% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.1%top 98.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

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---

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.170-1DEBIAN-CVE-2026-31519
Debian:13linux6.12.85-1DEBIAN-CVE-2026-31519
Debian:14linux6.19.11-1DEBIAN-CVE-2026-31519
Ubuntu:22.04:LTSlinuxno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux6.8.0-136.136UBUNTU-CVE-2026-31519
Ubuntu:25.10linuxno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-awsno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-aws6.8.0-1061.64UBUNTU-CVE-2026-31519
Ubuntu:25.10linux-awsno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-aws-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-aws-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1061.64~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azureno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure6.8.0-1063.71UBUNTU-CVE-2026-31519
Ubuntu:25.10linux-azureno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-6.11no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1063.71~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-fdeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-fde6.8.0-1062.69UBUNTU-CVE-2026-31519
Ubuntu:25.10linux-azure-fdeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-fde-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-azure-fde-6.86.8.0-1062.69~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-nvidiano fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-azure-nvidia-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gcpno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-gcp6.8.0-1064.72UBUNTU-CVE-2026-31519
Ubuntu:25.10linux-gcpno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-gcp-6.11no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-gcp-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-gcp-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1064.72~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gkeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-gke6.8.0-1059.67UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-gkeopno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1046.50UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-hwe-6.11no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-hwe-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-hwe-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-136.136~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-ibmno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-ibm6.8.0-1061.62UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1061.62~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-intel-iotgno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-kvmno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-lowlatencyno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-136.136.2UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-lowlatency-hwe-6.11no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-136.136.2~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-nvidiano fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1059.62UBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-nvidia-6.11no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-nvidia-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1059.62~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1059.62.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-nvidia-tegrano fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-nvidia-tegra6.8.0-1030.31UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-nvidia-tegra-igxno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oem-6.11no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oem-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oem-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oem-6.8no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oracleno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oracle6.8.0-1058.61UBUNTU-CVE-2026-31519
Ubuntu:25.10linux-oracleno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oracle-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-oracle-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1058.61~22.04.1UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-raspino fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-raspi6.8.0-1061.65UBUNTU-CVE-2026-31519
Ubuntu:25.10linux-raspino fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:25.10linux-realtimeno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2026-31519
Ubuntu:25.10linux-riscvno fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-riscv-6.14no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-riscv-6.17no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-136.136~22.04.3UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-vmware6.8.0-1008.8UBUNTU-CVE-2026-31519
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1033.34UBUNTU-CVE-2026-31519
Ubuntu:22.04:LTSlinux-xilinx-zynqmpno fix listedUBUNTU-CVE-2026-31519

Affected products (as reported)

VendorProductVersions
Linux Linux c71bf099abddf3e0fdc27f251ba76fca1461d49a – before d43da8de0ed376abafbad8a245a1835e8f66cb0fc71bf099abddf3e0fdc27f251ba76fca1461d49a – before c57276ced3c3207f42182dfa2f0d8e860357e111c71bf099abddf3e0fdc27f251ba76fca1461d49a – before a41a9b8d19a98b45591528c6e54d31cc66271d1ec71bf099abddf3e0fdc27f251ba76fca1461d49a – before 2ec578e6452138ab76f6c9a9c18711fcd197649fc71bf099abddf3e0fdc27f251ba76fca1461d49a – before 696683f214495db3cdacab9a713efaaced8660f8c71bf099abddf3e0fdc27f251ba76fca1461d49a – before 5131fa077f9bb386a1b901bf5b247041f0ec8f80c4ba0bd9db5e8fd2664be0fd4ec01335fe3268eb2.6.32.19 – before 2.6.33
Linux Linux 2.6.33

References