CVE-2024-26727: btrfs: do not ASSERT() if the newly created subvolume already got read
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.
This Linux kernel Btrfs flaw can trigger a kernel assertion failure during subvolume creation, causing a crash. The source describes a syzbot-discovered crash, not data theft or remote compromise. Business risk is mainly service availability for Linux systems using Btrfs, especially where subvolumes or snapshots are created.
Executive priority
Patch during normal Linux kernel maintenance, with higher priority for production systems using Btrfs snapshots or subvolumes. Treat this as an availability risk unless new vendor evidence shows broader impact or active exploitation.
Technical view
During Btrfs create_subvol(), another path such as a backref walk can read the new subvolume before btrfs_get_new_fs_root(). The code incorrectly ASSERTs that no anonymous device is assigned, leading to kernel BUG. The fix removes the ASSERT, frees the preallocated anon_dev, resets it, and continues.
Likely exposure
Exposure appears limited to affected Linux kernel versions with Btrfs in use and workflows that create subvolumes or snapshots. Exact exposure depends on distro backports and package versions, so asset owners should verify kernel build status against vendor advisories and the referenced stable commits.
Exploitation context
The provided sources cite a syzbot crash and KEV is false. There is no cited evidence of active exploitation. The crash path reaches Btrfs snapshot/subvolume ioctl handling, suggesting a local availability issue rather than a remotely reachable vulnerability based on available evidence.
Researcher notes
The core issue is an invalid invariant in Btrfs root handling, not a memory corruption claim in the provided text. The source does not provide CVSS, CWE, exploitability assessment, or evidence of malicious exploitation. Avoid overstating impact beyond kernel crash availability risk.
Mitigation direction
Update affected Linux kernels through distro packages or stable kernel releases containing the referenced fixes.
For Debian LTS systems, review and apply the cited Debian LTS security update.
Prioritize Btrfs hosts that perform frequent subvolume or snapshot operations.
Restrict Btrfs subvolume creation to trusted administrators where operationally feasible until patched.
Track vendor advisories for any distro-specific fixed package versions.
Validation and detection
Inventory Linux hosts using Btrfs filesystems.
Record running kernel versions and compare them with vendor fixed releases.
Check whether Btrfs subvolume or snapshot creation is available to non-admin workflows.
Confirm patch presence through distro changelogs or referenced stable commit backports.
Review recent kernel crash logs for Btrfs assertion or BUG messages.
Based on public source material and reviewed before publication.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2024-26727 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.