CVE-2026-80854: usb: gadget: f_tcm: keep port count until LUN teardown completes

Published Sep 4, 2026
·
Updated

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

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

tcmusbgdropnexus() permits session removal once tpgportcount reaches zero. However, usbgportunlink() currently decrements that count from the fabricpreunlink() callback, before coredevdellun() waits for active selun references to drain.

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

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

The generic target-core unlink path has no callback after coredevdellun() completes. Add an optional fabricpostunlink() callback and use it for the ftcm port count. The count now remains nonzero until coredevdellun() has finished draining active LUN references, preventing nexus removal from freeing the session during command completion.

Affected Software

1 affected component
Linux Linux kernel

Event History

Sep 4, 2026
CVE Published
via MITRE·03:55 PM
Data Sourced
via MITRE·03:55 PM
Description

Frequently Asked Questions

1

What conditions are required to trigger the issue?

The race requires the last LUN to be unlinked while a nexus is removed at the same time. Nexus removal must observe the target portal group port count as zero before active LUN references have finished draining.

2

What is the practical impact if the race occurs?

Nexus removal can free the session command map while an in-flight usbg_cmd and its work item are still accessible. Reported symptoms include a DEBUG_OBJECTS "free active" warning for usbg_cmd_work followed by a target-core BUG or Oops.

3

Which systems are exposed?

Systems using the Linux kernel USB gadget f_tcm function are affected when they perform the overlapping last-LUN unlink and nexus-removal operations described. The supplied data does not identify affected kernel versions or configuration defaults.

4

How does the fix prevent the race?

The fix adds an optional fabric_post_unlink() callback and moves the f_tcm port-count decrement to that stage. This keeps the count nonzero until core_dev_del_lun() has completed draining active LUN references, preventing session removal during command completion.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203