CVE-2024-26727

btrfs: do not ASSERT() if the newly created subvolume already got read

MEDIUM
5.5
CVSS Score
Published: April 3, 2024 at 02:55 PM UTC
Updated: June 17, 2026 at 07:18 AM UTC
2 products affected across 2 vendorsLinux KernelDebian Linux

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: do not ASSERT() if the newly created subvolume already got read [BUG] There is a syzbot crash, triggered by the ASSERT() during subvolume creation: assertion failed: !anon_dev, in fs/btrfs/disk-io.c:1319 ------------[ cut here ]------------ kernel BUG at fs/btrfs/disk-io.c:1319! invalid opcode: 0000 [#1] PREEMPT SMP KASAN RIP: 0010:btrfs_get_root_ref.part.0+0x9aa/0xa60 <TASK> btrfs_get_new_fs_root+0xd3/0xf0 create_subvol+0xd02/0x1650 btrfs_mksubvol+0xe95/0x12b0 __btrfs_ioctl_snap_create+0x2f9/0x4f0 btrfs_ioctl_snap_create+0x16b/0x200 btrfs_ioctl+0x35f0/0x5cf0 __x64_sys_ioctl+0x19d/0x210 do_syscall_64+0x3f/0xe0 entry_SYSCALL_64_after_hwframe+0x63/0x6b ---[ end trace 0000000000000000 ]--- [CAUSE] During create_subvol(), after inserting root item for the newly created subvolume, we would trigger btrfs_get_new_fs_root() to get the btrfs_root of that subvolume. The idea here is, we have preallocated an anonymous device number for the subvolume, thus we can assign it to the new subvolume. But there is really nothing preventing things like backref walk to read the new subvolume. If that happens before we call btrfs_get_new_fs_root(), the subvolume would be read out, with a new anonymous device number assigned already. In that case, we would trigger ASSERT(), as we really expect no one to read out that subvolume (which is not yet accessible from the fs). But things like backref walk is still possible to trigger the read on the subvolume. Thus our assumption on the ASSERT() is not correct in the first place. [FIX] Fix it by removing the ASSERT(), and just free the @anon_dev, reset it to 0, and continue. If the subvolume tree is read out by something else, it should have already get a new anon_dev assigned thus we only need to free the preallocated one.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 5.8.35.11 ≤ v < 5.15.1495.16 ≤ v < 6.1.795.8.3 ≤ v < 5.95.9 ≤ v < 5.10.2105.9 ≤ v < 5.15.1495.9 ≤ v < 6.1.795.9 ≤ v < 6.6.185.9 ≤ v < 6.7.65.9 ≤ v < 6.86.2 ≤ v < 6.6.186.7 ≤ v < 6.7.62dfb1e43f57dd3aeaa66f7cf05d068db2d4c87885.8.36.8 rc16.8 rc26.8 rc3917d608fe375041eb7f29befa6a6d7fd3cf32dde
Vendor states this is fixed in 3f5d47eb163bceb1b9e613c9003bae5fefc0046f (fixed)
Vendor states this is fixed in 5a172344bfdabb46458e03708735d7b1a918c468 (fixed)
Vendor states this is fixed in 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d (fixed)
Vendor states this is fixed in 833775656d447c545133a744a0ed1e189ce61430 (fixed)
Vendor states this is fixed in e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb (fixed)
Vendor states this is fixed in e31546b0f34af21738c4ceac47d662c00ee6382f (fixed)
Vendor states this is fixed in 5.10.210 (unaffected)
Vendor states this is fixed in 5.15.149 (unaffected)
Vendor states this is fixed in 5.9 (unaffected)
Vendor states this is fixed in 6.1.79 (unaffected)
Vendor states this is fixed in 6.6.18 (unaffected)
Vendor states this is fixed in 6.7.6 (unaffected)
Vendor states this is fixed in 6.8 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3f5d47eb163bceb1b9e613c9003bae5fefc0046f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/5a172344bfdabb46458e03708735d7b1a918c468
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/66b317a2fc45b2ef66527ee3f8fa08fb5beab88d
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/833775656d447c545133a744a0ed1e189ce61430
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e31546b0f34af21738c4ceac47d662c00ee6382f
Mailing List
Source: af854a3a-2127-422b-91ae-364da2661108
https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-617

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card