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

usb: gadget: f_tcm: keep port count until LUN teardown completes

tcm_usbg_drop_nexus() permits session removal once tpg_port_count
reaches zero. However, usbg_port_unlink() currently decrements that
count from the fabric_pre_unlink() callback, before core_dev_del_lun()
waits for active se_lun references to drain.

If removal of the last LUN races a nexus removal, the latter can observe
a zero port count and call target_remove_session(). This frees
sess_cmd_map while an in-flight struct usbg_cmd, including its work item,
can still be accessed.

Overlapping the last-LUN unlink with nexus removal reproduces this
lifetime violation as a DEBUG_OBJECTS "free active" warning for
usbg_cmd_work, followed by a target-core BUG/Oops.

The generic target-core unlink path has no callback after
core_dev_del_lun() completes. Add an optional fabric_post_unlink()
callback and use it for the f_tcm port count. The count now remains
nonzero until core_dev_del_lun() has finished draining active LUN
references, preventing nexus removal from freeing the session during
command completion.
Published: 2026-09-04
Score: n/a
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service and potential local privilege escalation via kernel crash
Action: Patch
AI Analysis

Impact

The Linux kernel gadget f_tcm driver contains a race condition that allows a session to be removed while the last logical unit number (LUN) is still being torn down. This condition can free a session structure that is still in use by an active command, leading to a use‑after‑free and an ensuing kernel crash or oops. An attacker controlling a USB gadget device could trigger this scenario, causing the target system to become unstable or to reject privileged operations. The immediate impact is a denial of service, and the crash could potentially be leveraged for local privilege escalation if additional vulnerabilities are present.

Affected Systems

The flaw affects all Linux kernel versions that include the f_tcm gadget driver prior to the patch in the referenced commits. Any system that loads the usb gadget f_tcm driver—commonly used for USB storage, Fibre Channel target emulation, or other device emulation—remains vulnerable. The vulnerability is not tied to a specific vendor beyond the Linux kernel distributed by Canonical, Red Hat, SUSE, and others.

Risk and Exploitability

No CVSS score is supplied, and EPSS is not available, so the quantitative risk cannot be precisely quantified. The flaw is not listed in CISA's KEV catalog, suggesting it has not yet been publicly exploited. However, because the vulnerability triggers a kernel crash and may be exercised by a local attacker or anyone who can control a USB gadget connection, the risk remains significant for devices that require high availability. The attack vector is likely local, involving the insertion of a USB gadget device that leverages f_tcm; remote exploitation would require the attacker to have physical or privileged access to the target machine.

Generated by OpenCVE AI on September 4, 2026 at 18:37 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the f_tcm patch from commit 178f59a0 or later.
  • If an immediate kernel upgrade is not possible, unload or block the f_tcm gadget driver (e.g., by editing /etc/modprobe.d or preventing the USB gadget from loading).
  • After applying the patch or disabling f_tcm, reboot the system to ensure the kernel module changes take effect.
  • Monitor kernel logs for any lingering use-after-free warnings or oopses following the update.

Generated by OpenCVE AI on September 4, 2026 at 18:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4777-1 linux security update
History

Fri, 04 Sep 2026 19:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-362
CWE-416

Fri, 04 Sep 2026 16:00:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_tcm: keep port count until LUN teardown completes tcm_usbg_drop_nexus() permits session removal once tpg_port_count reaches zero. However, usbg_port_unlink() currently decrements that count from the fabric_pre_unlink() callback, before core_dev_del_lun() waits for active se_lun references to drain. If removal of the last LUN races a nexus removal, the latter can observe a zero port count and call target_remove_session(). This frees sess_cmd_map while an in-flight struct usbg_cmd, including its work item, can still be accessed. Overlapping the last-LUN unlink with nexus removal reproduces this lifetime violation as a DEBUG_OBJECTS "free active" warning for usbg_cmd_work, followed by a target-core BUG/Oops. The generic target-core unlink path has no callback after core_dev_del_lun() completes. Add an optional fabric_post_unlink() callback and use it for the f_tcm port count. The count now remains nonzero until core_dev_del_lun() has finished draining active LUN references, preventing nexus removal from freeing the session during command completion.
Title usb: gadget: f_tcm: keep port count until LUN teardown completes
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-09-04T15:55:06.478Z

Reserved: 2026-08-26T14:34:25.797Z

Link: CVE-2026-80854

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-04T16:18:14.353

Modified: 2026-09-04T16:18:14.353

Link: CVE-2026-80854

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-09-05T02:00:12Z

Weaknesses
  • CWE-362

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

  • CWE-416

    Use After Free