# CVE-2025-40100: btrfs: do not assert we found block group item when creating free space tree

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.28% (percentile 13, 2026-11-28)
- **Published:** 2025-10-30T09:48:06.521Z
- **Modified:** 2026-10-19T21:10:00.160Z

## Who should check

- Anyone running Linux \>= a5ed91828518ab076209266c2bc510adabd078df, \< 4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6; \>= a5ed91828518ab076209266c2bc510adabd078df, \< 289498da343b05c886f19b4269429606f86dd17b; \>= a5ed91828518ab076209266c2bc510adabd078df, \< 3fdcfd91b93f930d87843156c7c8cc5fbcf9b144; \>= a5ed91828518ab076209266c2bc510adabd078df, \< eb145463f22d7d32d426b29fe9810de9e792b6ba; \>= a5ed91828518ab076209266c2bc510adabd078df, \< a5a51bf4e9b7354ce7cd697e610d72c1b33fd949
- Anyone running Linux 4.5

## Description

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

btrfs: do not assert we found block group item when creating free space tree

Currently, when building a free space tree at populate\_free\_space\_tree(),
if we are not using the block group tree feature, we always expect to find
block group items (either extent items or a block group item with key type
BTRFS\_BLOCK\_GROUP\_ITEM\_KEY) when we search the extent tree with
btrfs\_search\_slot\_for\_read(), so we assert that we found an item. However
this expectation is wrong since we can have a new block group created in
the current transaction which is still empty and for which we still have
not added the block group's item to the extent tree, in which case we do
not have any items in the extent tree associated to the block group.

The insertion of a new block group's block group item in the extent tree
happens at btrfs\_create\_pending\_block\_groups() when it calls the helper
insert\_block\_group\_item(). This typically is done when a transaction
handle is released, committed or when running delayed refs (either as
part of a transaction commit or when serving tickets for space reservation
if we are low on free space).

So remove the assertion at populate\_free\_space\_tree() even when the block
group tree feature is not enabled and update the comment to mention this
case.

Syzbot reported this with the following stack trace:

  BTRFS info (device loop3 state M): rebuilding free space tree
  assertion failed: ret == 0 :: 0, in fs/btrfs/free-space-tree.c:1115
  ------------\[ cut here \]------------
  kernel BUG at fs/btrfs/free-space-tree.c:1115!
  Oops: invalid opcode: 0000 \[\#1\] SMP KASAN PTI
  CPU: 1 UID: 0 PID: 6352 Comm: syz.3.25 Not tainted syzkaller \#0 PREEMPT(full)
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
  RIP: 0010:populate\_free\_space\_tree+0x700/0x710 fs/btrfs/free-space-tree.c:1115
  Code: ff ff e8 d3 (...)
  RSP: 0018:ffffc9000430f780 EFLAGS: 00010246
  RAX: 0000000000000043 RBX: ffff88805b709630 RCX: fea61d0e2e79d000
  RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
  RBP: ffffc9000430f8b0 R08: ffffc9000430f4a7 R09: 1ffff92000861e94
  R10: dffffc0000000000 R11: fffff52000861e95 R12: 0000000000000001
  R13: 1ffff92000861f00 R14: dffffc0000000000 R15: 0000000000000000
  FS:  00007f424d9fe6c0(0000) GS:ffff888125afc000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 00007fd78ad212c0 CR3: 0000000076d68000 CR4: 00000000003526f0
  Call Trace:
   \<TASK\>
   btrfs\_rebuild\_free\_space\_tree+0x1ba/0x6d0 fs/btrfs/free-space-tree.c:1364
   btrfs\_start\_pre\_rw\_mount+0x128f/0x1bf0 fs/btrfs/disk-io.c:3062
   btrfs\_remount\_rw fs/btrfs/super.c:1334 \[inline\]
   btrfs\_reconfigure+0xaed/0x2160 fs/btrfs/super.c:1559
   reconfigure\_super+0x227/0x890 fs/super.c:1076
   do\_remount fs/namespace.c:3279 \[inline\]
   path\_mount+0xd1a/0xfe0 fs/namespace.c:4027
   do\_mount fs/namespace.c:4048 \[inline\]
   \_\_do\_sys\_mount fs/namespace.c:4236 \[inline\]
   \_\_se\_sys\_mount+0x313/0x410 fs/namespace.c:4213
   do\_syscall\_x64 arch/x86/entry/syscall\_64.c:63 \[inline\]
   do\_syscall\_64+0xfa/0xfa0 arch/x86/entry/syscall\_64.c:94
   entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
   RIP: 0033:0x7f424e39066a
  Code: d8 64 89 02 (...)
  RSP: 002b:00007f424d9fde68 EFLAGS: 00000246 ORIG\_RAX: 00000000000000a5
  RAX: ffffffffffffffda RBX: 00007f424d9fdef0 RCX: 00007f424e39066a
  RDX: 0000200000000180 RSI: 0000200000000380 RDI: 0000000000000000
  RBP: 0000200000000180 R08: 00007f424d9fdef0 R09: 0000000000000020
  R10: 0000000000000020 R11: 0000000000000246 R12: 0000200000000380
  R13: 00007f424d9fdeb0 R14: 0000000000000000 R15: 00002000000002c0
   \</TASK\>
  Modules linked in:
  ---\[ end trace 0000000000000000 \]---

## Affected and fixed versions

- Linux: \>= a5ed91828518ab076209266c2bc510adabd078df, \< 4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6; \>= a5ed91828518ab076209266c2bc510adabd078df, \< 289498da343b05c886f19b4269429606f86dd17b; \>= a5ed91828518ab076209266c2bc510adabd078df, \< 3fdcfd91b93f930d87843156c7c8cc5fbcf9b144; \>= a5ed91828518ab076209266c2bc510adabd078df, \< eb145463f22d7d32d426b29fe9810de9e792b6ba; \>= a5ed91828518ab076209266c2bc510adabd078df, \< a5a51bf4e9b7354ce7cd697e610d72c1b33fd949 (cvelist)
- Linux: 4.5 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-40100.md
Affected: Linux >= a5ed91828518ab076209266c2bc510adabd078df, < 4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6; >= a5ed91828518ab076209266c2bc510adabd078df, < 289498da343b05c886f19b4269429606f86dd17b; >= a5ed91828518ab076209266c2bc510adabd078df, < 3fdcfd91b93f930d87843156c7c8cc5fbcf9b144; >= a5ed91828518ab076209266…
Fixed in: Linux 4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6, Linux 289498da343b05c886f19b4269429606f86dd17b, Linux 3fdcfd91b93f930d87843156c7c8cc5fbcf9b144

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-2025-40100 being exploited?

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

### How serious is CVE-2025-40100?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2025-40100?

Linux \>= a5ed91828518ab076209266c2bc510adabd078df, \< 4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6; \>= a5ed91828518ab076209266c2bc510adabd078df, \< 289498da343b05c886f19b4269429606f86dd17b; \>= a5ed91828518ab076209266c2bc510adabd078df, \< 3fdcfd91b93f930d87843156c7c8cc5fbcf9b144; \>= a5ed91828518ab076209266c2bc510adabd078df, \< eb145463f22d7d32d426b29fe9810de9e792b6ba; \>= a5ed91828518ab076209266c2bc510adabd078df, \< a5a51bf4e9b7354ce7cd697e610d72c1b33fd949; Linux 4.5.

### Is there a fix for CVE-2025-40100?

Yes. Fixed in Linux 4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6, Linux 289498da343b05c886f19b4269429606f86dd17b, Linux 3fdcfd91b93f930d87843156c7c8cc5fbcf9b144. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-40100?

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

- other: <https://git.kernel.org/stable/c/4f4b9ca73f84130d9fbb0fc02306ce94ce8bdbe6>
- other: <https://git.kernel.org/stable/c/289498da343b05c886f19b4269429606f86dd17b>
- other: <https://git.kernel.org/stable/c/3fdcfd91b93f930d87843156c7c8cc5fbcf9b144>
- other: <https://git.kernel.org/stable/c/eb145463f22d7d32d426b29fe9810de9e792b6ba>
- other: <https://git.kernel.org/stable/c/a5a51bf4e9b7354ce7cd697e610d72c1b33fd949>

## 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-2025-40100>

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