Vulnerability · Published May 20, 2025 · Assigned by Linux

CVE-2025-37904btrfs: fix the inode leak in btrfs_iget()

Medium 5.5

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 7% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)5.5Medium
Exploit odds (30 days)0.2%top 93.4% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-aws-6.146.14.0-1009.9~24.04.1UBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-aws-6.146.14.0-1009.9~24.04.1USN-7665-2
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:25.10linux-azure-fdeno fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-gcp-6.146.14.0-1011.11~24.04.1UBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-oem-6.146.14.0-1007.7USN-7650-1
Ubuntu:24.04:LTSlinux-oem-6.146.14.0-1007.7UBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-oracle-6.146.14.0-1009.9~24.04.1UBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:24.04:LTSlinux-riscv-6.146.14.0-24.24.1~24.04.1UBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2025-37904
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2025-37904

Affected products (as reported)

VendorProductVersions
Linux Linux 7c855e16ab72596d771355050ffe026e6b99f91c – before 30a339bece3a44ab0a821477139e84fb86af97617c855e16ab72596d771355050ffe026e6b99f91c – before 48c1d1bb525b1c44b8bdc8e7ec5629cb6c2b9fc4
Linux Linux 6.13

References