CVE-2026-139014

f2fs: drop pending discard commands before reserving device alias

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

f2fs: drop pending discard commands before reserving device alias

When reserving a device alias via f2fs_ioc_reserve_dev_alias(),
f2fs_reserve_device_alias() bulk-marks all blocks in the target device
range as valid in SIT.

However, if the device was previously in the released state, stale
pending discard commands covering that range may still exist in dcc->root.
When f2fs_issue_discard_thread later processes those commands,
__check_sit_bitmap() detects valid blocks in the discard range and
triggers a kernel BUG().

To fix this:
1. Introduce f2fs_drop_discard_cmd_range() to traverse the discard rbtree,
drop all pending D_PREP discard commands in the range,
and wait for any in-flight discard bios under dcc->cmd_lock.
2. Call f2fs_drop_discard_cmd_range() in f2fs_ioc_reserve_dev_alias()
before f2fs_reserve_device_alias().

Analysis

AI-generated

Technical impact

A flaw in the Linux kernel’s f2fs filesystem causes the kernel to BUG due to stale discard commands that are not cleared before a device alias is reserved. The bug leads to a kernel crash, which can render the system unavailable. The underlying weakness is a race condition whereby pending discard commands are processed after a new alias reservation, causing a bitmap check to fail. This issue has the potential to cause loss of confidentiality, integrity, and availability of the affected system.

Affected Systems

The problem affects all Linux kernel builds that include the f2fs filesystem. Specific affected kernel versions are not listed in the CVE data, so all releases using f2fs are potentially vulnerable until the patch that introduces f2fs_drop_discard_cmd_range is deployed.

Risk and Exploitability

No EPSS score or CVSS metrics are provided, and the vulnerability is not in the CISA KEV list. The attack likely requires local access to perform a device alias reservation while stale discard commands are pending, making the exploit vector local or potentially remote if an attacker can trigger the discard mechanism via a vulnerable service. Because the vulnerability triggers a kernel BUG, any successful exploitation results in a denial‑of‑service. Overall risk and likelihood are uncertain due to missing exploitation data, but the impact is severe if the flaw is triggered.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the kernel to a version that contains the f2fs_drop_discard_cmd_range patch.
  • If an update is not available, avoid using f2fs device alias reservation features or switch to a different filesystem.
  • Restart the system or remount f2fs mounts to clear pending discard commands, which can temporarily mitigate the issue until a patch is applied.

Generated by OpenCVE AI on November 30, 2026 at 18:28 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-362
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: f2fs: drop pending discard commands before reserving device alias When reserving a device alias via f2fs_ioc_reserve_dev_alias(), f2fs_reserve_device_alias() bulk-marks all blocks in the target device range as valid in SIT. However, if the device was previously in the released state, stale pending discard commands covering that range may still exist in dcc->root. When f2fs_issue_discard_thread later processes those commands, __check_sit_bitmap() detects valid blocks in the discard range and triggers a kernel BUG(). To fix this: 1. Introduce f2fs_drop_discard_cmd_range() to traverse the discard rbtree, drop all pending D_PREP discard commands in the range, and wait for any in-flight discard bios under dcc->cmd_lock. 2. Call f2fs_drop_discard_cmd_range() in f2fs_ioc_reserve_dev_alias() before f2fs_reserve_device_alias().
Title f2fs: drop pending discard commands before reserving device alias
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')

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:27 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM