btrfs: update the inode item when removing a free space inode

State
Published
Severity
Not Scored
Published
Nov 30, 2026
Updated
Nov 30, 2026
Reserved
Nov 30, 2026

Read the record on cve.org

Description

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

btrfs: update the inode item when removing a free space inode

btrfs_remove_free_space_inode() adds an orphan item for the free space inode and clears its link count in memory, but never writes the inode item. The item is only removed once the delayed iput evicts the inode, which happens in a later transaction, from the cleaner thread or a throttled transaction end.

If we crash in between, or if evict can't reserve space for the truncation and leaves the orphan item for the next mount, the on-disk inode still has a link count of 1. btrfs_orphan_cleanup() then treats it as an inode with links and only deletes the orphan item. The free space header item is already gone at that point, so nothing ever finds the inode again, and its data extents are leaked.

Write the zero link count to the inode item in the same transaction as the orphan item, so the orphan cleanup evicts the inode instead. Account for the extra tree root item update when removing a block group.

ProductVersions
Linux Linux455757c322cc0a0f2a692c5625dd88aaf6a7b889 to before 36bc2d3b07f8e0818ad5be80bfcb869b5d34e112 Affected455757c322cc0a0f2a692c5625dd88aaf6a7b889 to before 53e6ca355cbce4fedb0f2cdd70efb7944e844562 Affected455757c322cc0a0f2a692c5625dd88aaf6a7b889 to before b70c83b83cb651413f2215822c3e5def884d6b05 Affected455757c322cc0a0f2a692c5625dd88aaf6a7b889 to before 4e89aff9ad6fcbec555c38169807c4023f93450f Affected
Linux Linux3.2 Affectedbefore 3.2 Not Affected6.12.119 through 6.12.* Not Affected6.18.65 through 6.18.* Not Affected7.3.6 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.