# CVE-2024-26727: btrfs: do not ASSERT() if the newly created subvolume already got read

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-617
- **Published:** 2024-04-03T14:55:25.805Z
- **Modified:** 2026-06-17T07:18:11.373Z

## Who should check

- Anyone running Linux \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 3f5d47eb163bceb1b9e613c9003bae5fefc0046f; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< e31546b0f34af21738c4ceac47d662c00ee6382f; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 833775656d447c545133a744a0ed1e189ce61430; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 5a172344bfdabb46458e03708735d7b1a918c468; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb; 917d608fe375041eb7f29befa6a6d7fd3cf32dde; \>= 5.8.3, \< 5.9
- Anyone running Linux 5.9

## 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 and fixed versions

- Linux: \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 3f5d47eb163bceb1b9e613c9003bae5fefc0046f; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< e31546b0f34af21738c4ceac47d662c00ee6382f; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 833775656d447c545133a744a0ed1e189ce61430; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 5a172344bfdabb46458e03708735d7b1a918c468; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb; 917d608fe375041eb7f29befa6a6d7fd3cf32dde; \>= 5.8.3, \< 5.9 (cvelist)
- Linux: 5.9 (cvelist)

## Mitigation

- Upgrade Linux to 5.9 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-26727. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-26727.md
Affected: Linux >= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, < 3f5d47eb163bceb1b9e613c9003bae5fefc0046f; >= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, < e31546b0f34af21738c4ceac47d662c00ee6382f; >= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, < 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d; >= 2dfb1e43f57dd3aeaa66f7c…
Fixed in: Linux 3f5d47eb163bceb1b9e613c9003bae5fefc0046f, Linux 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d, Linux 833775656d447c545133a744a0ed1e189ce61430, Linux 5a172344bfdabb46458e03708735d7b1a918c468, Linux 5.9

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-26727 being exploited?

There is no confirmed exploitation: CVE-2024-26727 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-26727?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2024-26727?

Linux \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 3f5d47eb163bceb1b9e613c9003bae5fefc0046f; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< e31546b0f34af21738c4ceac47d662c00ee6382f; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 833775656d447c545133a744a0ed1e189ce61430; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< 5a172344bfdabb46458e03708735d7b1a918c468; \>= 2dfb1e43f57dd3aeaa66f7cf05d068db2d4c8788, \< e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb; 917d608fe375041eb7f29befa6a6d7fd3cf32dde; \>= 5.8.3, \< 5.9; Linux 5.9.

### Is there a fix for CVE-2024-26727?

Yes. Fixed in Linux 3f5d47eb163bceb1b9e613c9003bae5fefc0046f, Linux 66b317a2fc45b2ef66527ee3f8fa08fb5beab88d, Linux 833775656d447c545133a744a0ed1e189ce61430, Linux 5a172344bfdabb46458e03708735d7b1a918c468, Linux 5.9. Upgrade Linux to 5.9 or later.

### How do I check if I'm affected by CVE-2024-26727?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/3f5d47eb163bceb1b9e613c9003bae5fefc0046f>
- patch: <https://git.kernel.org/stable/c/e31546b0f34af21738c4ceac47d662c00ee6382f>
- patch: <https://git.kernel.org/stable/c/66b317a2fc45b2ef66527ee3f8fa08fb5beab88d>
- patch: <https://git.kernel.org/stable/c/833775656d447c545133a744a0ed1e189ce61430>
- patch: <https://git.kernel.org/stable/c/5a172344bfdabb46458e03708735d7b1a918c468>
- patch: <https://git.kernel.org/stable/c/e03ee2fe873eb68c1f9ba5112fee70303ebf9dfb>
- other: <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-26727>

HTML: <https://flawdb.com/CVE-2024-26727> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-26727>
