CVE-2026-99756: btrfs: prevent deleting the wrong subvolume by ID
In the Linux kernel, the following vulnerability has been resolved:
btrfs: prevent deleting the wrong subvolume by ID
When deleting a subvolume by ID, btrfsioctlsnapdestroy() first resolves the requested ID to a name, then looks up that name again under the parent directory lock.
A concurrent rename can change which subvolume is associated with the name between these operations. Since the deletion path does not verify the ID of the resolved subvolume, it can delete a different subvolume while leaving the requested one intact.
This was reproduced by repeatedly exchanging the names of two subvolumes using renameat2(RENAMEEXCHANGE) while deleting one of them by ID. The wrong subvolume was deleted in 9 out of 14 independent tests.
Fix this by checking that the resolved subvolume ID matches the requested ID while holding the parent directory lock. Return -EAGAIN on a mismatch so that userspace can retry the operation instead of being told that the requested subvolume does not exist.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What conditions are required to trigger the incorrect deletion?
The operation must delete a Btrfs subvolume by ID while another concurrent actor renames subvolumes. The reported reproduction repeatedly exchanged the names of two subvolumes with renameat2(RENAME_EXCHANGE) during deletion.
What is the practical impact of a successful race?
A subvolume other than the one requested by ID can be deleted, while the requested subvolume remains intact. In the reported testing, the wrong subvolume was deleted in 9 of 14 independent tests.
How does the fix change behavior during concurrent renames?
The deletion path verifies under the parent directory lock that the resolved subvolume ID still matches the requested ID. If it does not match, it returns -EAGAIN so userspace can retry rather than treating the requested subvolume as nonexistent.