# CVE-2025-38370: btrfs: fix failure to rebuild free space tree using multiple transactions

> 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.22% (percentile 8, 2026-11-26)
- **Published:** 2025-07-25T12:53:13.515Z
- **Modified:** 2026-06-17T09:16:43.340Z

## Who should check

- Anyone running Linux \>= 882af9f13e830c0a4ef696bb72cd5998a5067a93, \< 88fdd4899ea9bfe6cf943f099fcf8ad5df153782; \>= 882af9f13e830c0a4ef696bb72cd5998a5067a93, \< 1e6ed33cabba8f06f532f2e5851a102602823734
- Anyone running Linux 6.14

## Description

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

btrfs: fix failure to rebuild free space tree using multiple transactions

If we are rebuilding a free space tree, while modifying the free space
tree we may need to allocate a new metadata block group.
If we end up using multiple transactions for the rebuild, when we call
btrfs\_end\_transaction() we enter btrfs\_create\_pending\_block\_groups()
which calls add\_block\_group\_free\_space() to add items to the free space
tree for the block group.

Then later during the free space tree rebuild, at
btrfs\_rebuild\_free\_space\_tree(), we may find such new block groups
and call populate\_free\_space\_tree() for them, which fails with -EEXIST
because there are already items in the free space tree. Then we abort the
transaction with -EEXIST at btrfs\_rebuild\_free\_space\_tree().
Notice that we say "may find" the new block groups because a new block
group may be inserted in the block groups rbtree, which is being iterated
by the rebuild process, before or after the current node where the rebuild
process is currently at.

Syzbot recently reported such case which produces a trace like the
following:

  ------------\[ cut here \]------------
  BTRFS: Transaction aborted (error -17)
  WARNING: CPU: 1 PID: 7626 at fs/btrfs/free-space-tree.c:1341 btrfs\_rebuild\_free\_space\_tree+0x470/0x54c fs/btrfs/free-space-tree.c:1341
  Modules linked in:
  CPU: 1 UID: 0 PID: 7626 Comm: syz.2.25 Not tainted 6.15.0-rc7-syzkaller-00085-gd7fa1af5b33e-dirty \#0 PREEMPT
  Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
  pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  pc : btrfs\_rebuild\_free\_space\_tree+0x470/0x54c fs/btrfs/free-space-tree.c:1341
  lr : btrfs\_rebuild\_free\_space\_tree+0x470/0x54c fs/btrfs/free-space-tree.c:1341
  sp : ffff80009c4f7740
  x29: ffff80009c4f77b0 x28: ffff0000d4c3f400 x27: 0000000000000000
  x26: dfff800000000000 x25: ffff70001389eee8 x24: 0000000000000003
  x23: 1fffe000182b6e7b x22: 0000000000000000 x21: ffff0000c15b73d8
  x20: 00000000ffffffef x19: ffff0000c15b7378 x18: 1fffe0003386f276
  x17: ffff80008f31e000 x16: ffff80008adbe98c x15: 0000000000000001
  x14: 1fffe0001b281550 x13: 0000000000000000 x12: 0000000000000000
  x11: ffff60001b281551 x10: 0000000000000003 x9 : 1c8922000a902c00
  x8 : 1c8922000a902c00 x7 : ffff800080485878 x6 : 0000000000000000
  x5 : 0000000000000001 x4 : 0000000000000001 x3 : ffff80008047843c
  x2 : 0000000000000001 x1 : ffff80008b3ebc40 x0 : 0000000000000001
  Call trace:
   btrfs\_rebuild\_free\_space\_tree+0x470/0x54c fs/btrfs/free-space-tree.c:1341 (P)
   btrfs\_start\_pre\_rw\_mount+0xa78/0xe10 fs/btrfs/disk-io.c:3074
   btrfs\_remount\_rw fs/btrfs/super.c:1319 \[inline\]
   btrfs\_reconfigure+0x828/0x2418 fs/btrfs/super.c:1543
   reconfigure\_super+0x1d4/0x6f0 fs/super.c:1083
   do\_remount fs/namespace.c:3365 \[inline\]
   path\_mount+0xb34/0xde0 fs/namespace.c:4200
   do\_mount fs/namespace.c:4221 \[inline\]
   \_\_do\_sys\_mount fs/namespace.c:4432 \[inline\]
   \_\_se\_sys\_mount fs/namespace.c:4409 \[inline\]
   \_\_arm64\_sys\_mount+0x3e8/0x468 fs/namespace.c:4409
   \_\_invoke\_syscall arch/arm64/kernel/syscall.c:35 \[inline\]
   invoke\_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49
   el0\_svc\_common+0x130/0x23c arch/arm64/kernel/syscall.c:132
   do\_el0\_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
   el0\_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767
   el0t\_64\_sync\_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786
   el0t\_64\_sync+0x198/0x19c arch/arm64/kernel/entry.S:600
  irq event stamp: 330
  hardirqs last  enabled at (329): \[\<ffff80008048590c\>\] raw\_spin\_rq\_unlock\_irq kernel/sched/sched.h:1525 \[inline\]
  hardirqs last  enabled at (329): \[\<ffff80008048590c\>\] finish\_lock\_switch+0xb0/0x1c0 kernel/sched/core.c:5130
  hardirqs last disabled at (330): \[\<ffff80008adb9e60\>\] el1\_dbg+0x24/0x80 arch/arm64/kernel/entry-common.c:511
  softirqs last  enabled at (10): \[\<ffff8000801fbf10\>\] local\_bh\_enable+0
---truncated---

## Affected and fixed versions

- Linux: \>= 882af9f13e830c0a4ef696bb72cd5998a5067a93, \< 88fdd4899ea9bfe6cf943f099fcf8ad5df153782; \>= 882af9f13e830c0a4ef696bb72cd5998a5067a93, \< 1e6ed33cabba8f06f532f2e5851a102602823734 (cvelist)
- Linux: 6.14 (cvelist)

## Mitigation

- Upgrade Linux to 1e6ed33cabba8f06f532f2e5851a102602823734 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-38370.md
Affected: Linux >= 882af9f13e830c0a4ef696bb72cd5998a5067a93, < 88fdd4899ea9bfe6cf943f099fcf8ad5df153782; >= 882af9f13e830c0a4ef696bb72cd5998a5067a93, < 1e6ed33cabba8f06f532f2e5851a102602823734; Linux 6.14
Fixed in: Linux 88fdd4899ea9bfe6cf943f099fcf8ad5df153782, Linux 1e6ed33cabba8f06f532f2e5851a102602823734

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-38370 being exploited?

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

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

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

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

Linux \>= 882af9f13e830c0a4ef696bb72cd5998a5067a93, \< 88fdd4899ea9bfe6cf943f099fcf8ad5df153782; \>= 882af9f13e830c0a4ef696bb72cd5998a5067a93, \< 1e6ed33cabba8f06f532f2e5851a102602823734; Linux 6.14.

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

Yes. Fixed in Linux 88fdd4899ea9bfe6cf943f099fcf8ad5df153782, Linux 1e6ed33cabba8f06f532f2e5851a102602823734. Upgrade Linux to 1e6ed33cabba8f06f532f2e5851a102602823734 or later.

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

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/88fdd4899ea9bfe6cf943f099fcf8ad5df153782>
- patch: <https://git.kernel.org/stable/c/1e6ed33cabba8f06f532f2e5851a102602823734>

## 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-38370>

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