CVE-2026-139333

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

Published Nov 30, 2026 CVSS 3.1 · 2.5 Low EPSS n/a KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The kernel patch reveals that btrfs_remove_free_space_inode adds an orphan entry and clears the inode’s link count but never commits the updated inode item. If a crash occurs before the inode is written or the eviction cannot reserve space for truncation, the on‑disk inode retains a link count of one when the orphan cleanup runs. The orphan cleaner therefore treats the inode as still in use and only removes the orphan entry. The free space header has already been deleted, so the inode can never be located again and its data extents remain on disk, resulting in persistent orphaned extents and potential data loss.

Affected Systems

All Linux kernel releases that contain the buggy btrfs_remove_free_space_inode logic are affected. The specific version range is not listed, but any kernel prior to the commit that introduced the fix is vulnerable.

Risk and Exploitability

Exploitation would require a crash or a situation where the eviction cannot reserve space during truncation, conditions that are not trivially controllable by remote attackers. Because no EPSS score is available and the vulnerability is not listed in CISA’s KEV catalog, the likely exposure is moderate and limited to data loss or file system inconsistency rather than direct code execution. Hosts should consider the risk high enough to apply the patch promptly, especially if the system runs btrfs mounts that may encounter frequent crashes or heavy write activity.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a Linux kernel version that includes the commit adding the zero‑link count update to the inode item during free space inode removal
  • Re‑mount any btrfs volumes after applying the kernel update to ensure the updated inode state is used
  • Verify that no orphaned or free space inodes remain by checking btrfs status and inspecting the filesystem for unrecovered extents

Generated by OpenCVE AI on December 1, 2026 at 07:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-772
References
Metrics threat_severity

None

cvssV3_1

{'score': 2.5, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L'}

threat_severity

Low

Type Values Removed Values Added
Weaknesses CWE-362
CWE-403
Type Values Removed Values Added
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.
Title btrfs: update the inode item when removing a free space inode
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • CWE-403

    Exposure of File Descriptor to Unintended Control Sphere ('File Descriptor Leak')

  • CWE-772

    Missing Release of Resource after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:33 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM
Severity
Low
Public date
Nov 30, 2026, 1:33 PM