# CVE-2025-37904: btrfs: fix the inode leak in btrfs\_iget()

> 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.24% (percentile 9, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-05-20T15:21:38.075Z
- **Modified:** 2026-06-17T09:15:40.140Z

## Who should check

- Anyone running Linux \>= 7c855e16ab72596d771355050ffe026e6b99f91c, \< 30a339bece3a44ab0a821477139e84fb86af9761; \>= 7c855e16ab72596d771355050ffe026e6b99f91c, \< 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4
- Anyone running Linux 6.13

## Description

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

btrfs: fix the inode leak in btrfs\_iget()

\[BUG\]
There is a bug report that a syzbot reproducer can lead to the following
busy inode at unmount time:

  BTRFS info (device loop1): last unmount of filesystem 1680000e-3c1e-4c46-84b6-56bd3909af50
  VFS: Busy inodes after unmount of loop1 (btrfs)
  ------------\[ cut here \]------------
  kernel BUG at fs/super.c:650!
  Oops: invalid opcode: 0000 \[\#1\] SMP KASAN NOPTI
  CPU: 0 UID: 0 PID: 48168 Comm: syz-executor Not tainted 6.15.0-rc2-00471-g119009db2674 \#2 PREEMPT(full)
  Hardware name: QEMU Ubuntu 24.04 PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
  RIP: 0010:generic\_shutdown\_super+0x2e9/0x390 fs/super.c:650
  Call Trace:
   \<TASK\>
   kill\_anon\_super+0x3a/0x60 fs/super.c:1237
   btrfs\_kill\_super+0x3b/0x50 fs/btrfs/super.c:2099
   deactivate\_locked\_super+0xbe/0x1a0 fs/super.c:473
   deactivate\_super fs/super.c:506 \[inline\]
   deactivate\_super+0xe2/0x100 fs/super.c:502
   cleanup\_mnt+0x21f/0x440 fs/namespace.c:1435
   task\_work\_run+0x14d/0x240 kernel/task\_work.c:227
   resume\_user\_mode\_work include/linux/resume\_user\_mode.h:50 \[inline\]
   exit\_to\_user\_mode\_loop kernel/entry/common.c:114 \[inline\]
   exit\_to\_user\_mode\_prepare include/linux/entry-common.h:329 \[inline\]
   \_\_syscall\_exit\_to\_user\_mode\_work kernel/entry/common.c:207 \[inline\]
   syscall\_exit\_to\_user\_mode+0x269/0x290 kernel/entry/common.c:218
   do\_syscall\_64+0xd4/0x250 arch/x86/entry/syscall\_64.c:100
   entry\_SYSCALL\_64\_after\_hwframe+0x77/0x7f
   \</TASK\>

\[CAUSE\]
When btrfs\_alloc\_path() failed, btrfs\_iget() directly returned without
releasing the inode already allocated by btrfs\_iget\_locked().

This results the above busy inode and trigger the kernel BUG.

\[FIX\]
Fix it by calling iget\_failed() if btrfs\_alloc\_path() failed.

If we hit error inside btrfs\_read\_locked\_inode(), it will properly call
iget\_failed(), so nothing to worry about.

Although the iget\_failed() cleanup inside btrfs\_read\_locked\_inode() is a
break of the normal error handling scheme, let's fix the obvious bug
and backport first, then rework the error handling later.

## Affected and fixed versions

- Linux: \>= 7c855e16ab72596d771355050ffe026e6b99f91c, \< 30a339bece3a44ab0a821477139e84fb86af9761; \>= 7c855e16ab72596d771355050ffe026e6b99f91c, \< 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4 (cvelist)
- Linux: 6.13 (cvelist)

## Mitigation

- Upgrade Linux to 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4 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-37904. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-37904.md
Affected: Linux >= 7c855e16ab72596d771355050ffe026e6b99f91c, < 30a339bece3a44ab0a821477139e84fb86af9761; >= 7c855e16ab72596d771355050ffe026e6b99f91c, < 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4; Linux 6.13
Fixed in: Linux 30a339bece3a44ab0a821477139e84fb86af9761, Linux 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4

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

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

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

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

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

Linux \>= 7c855e16ab72596d771355050ffe026e6b99f91c, \< 30a339bece3a44ab0a821477139e84fb86af9761; \>= 7c855e16ab72596d771355050ffe026e6b99f91c, \< 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4; Linux 6.13.

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

Yes. Fixed in Linux 30a339bece3a44ab0a821477139e84fb86af9761, Linux 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4. Upgrade Linux to 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4 or later.

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

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/30a339bece3a44ab0a821477139e84fb86af9761>
- patch: <https://git.kernel.org/stable/c/48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4>

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

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