Skip to contentSkip to conversation

CVE-2026-99756: btrfs: prevent deleting the wrong subvolume by ID

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Nov 20

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

btrfs: prevent deleting the wrong subvolume by ID

When deleting a subvolume by ID, btrfs_ioctl_snap_destroy() 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(RENAME_EXCHANGE) 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.

The Linux kernel CVE team has assigned CVE-2026-99756 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.7 with commit 949964c928430a42e0d4f514d888a58a201b6fcb and fixed in 7.3.5 with commit db399899dbac590d7d124b6896bd113916e7ab09
	Issue introduced in 5.7 with commit 949964c928430a42e0d4f514d888a58a201b6fcb and fixed in 7.4-rc2 with commit 1960146913b31b288ed2cd607d103ee3b41681d4

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-99756

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
fs/btrfs/ioctl.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/db399899dbac590d7d124b6896bd113916e7ab09
	https://git.kernel.org/stable/c/1960146913b31b288ed2cd607d103ee3b41681d4