btrfs: set BTRFS_ROOT_ORPHAN_CLEANUP during subvol create
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ c71bf099abddf3e0fdc27f251ba76fca1461d49a · < 5131fa077f9bb386a1b901bf5b247041f0ec8f80| No fix yet |
| Linux Linux |
|
|
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().
From the CVE record · Linux
A race in Linux kernel btrfs orphan cleanup can leave a valid subvolume with a broken dentry after its dentry cache is dropped and a later lookup runs cleanup. The subvolume may become inaccessible, deletion can fail, and creating an entry over it can abort the filesystem. The input does not establish authentication requirements or a remote attack path.
Engineers running Linux kernels with btrfs subvolumes should check their kernel vendor’s advisory for affected versions.