CVE-2026-89739: usb: dwc3: gadget: Fix use-after-free in dwc3_gadget_free_endpoints due to race condition

Published Sep 11, 2026
·
Updated

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

usb: dwc3: gadget: Fix use-after-free in dwc3gadgetfreeendpoints due to race condition

In dwc3gadgetinitendpoint, &dep->nostreamwork is bound with dwc3nostreamwork, and dwc3gadgetendpointstreamevent can queue this delayed work on systempercpuwq when a DEPEVTSTREAMNOSTREAM event is received.

If we remove the gadget, dwc3gadgetfreeendpoints makes cleanup and the memory allocated for dep with kzalloc() is released by kfree(dep), while the delayed work mentioned above may still be pending or running. The sequence of operations that may lead to a UAF bug is as follows:

CPU0 CPU1

| dwc3threadinterrupt | dwc3endpointinterrupt | dwc3gadgetendpointstreamevent | queuedelayedwork(systempercpuwq, | &dep->nostreamwork) dwc3gadgetfreeendpoints | dwc3freetrbpool(dep) | listdel(&dep->endpoint.eplist) | dwc3debugfsremoveendpointdir(dep) | kfree(dep) | // dep is freed | | dwc3nostreamwork | // use dep (use-after-free)

Fix it by canceling the delayed work before kfree(dep) in dwc3gadgetfreeendpoints.

Affected Software

1 affected component
Linux Linux kernel

Event History

Sep 11, 2026
CVE Published
via MITRE·07:46 PM
Data Sourced
via MITRE·07:46 PM
Description

Frequently Asked Questions

1

What conditions are required for the use-after-free to occur?

The DWC3 gadget must receive a DEPEVT_STREAM_NOSTREAM event, which queues nostream_work on system_percpu_wq. The gadget must then be removed while that delayed work is still pending or executing, allowing the work handler to access an endpoint structure after it has been freed.

2

Which systems are exposed?

Systems using the Linux kernel's DWC3 USB gadget functionality are exposed when the affected endpoint stream-event path can run. The provided information does not identify specific kernel versions, hardware platforms, or default configurations.

3

What should be done if the fix cannot be applied immediately?

No mitigation is provided in the available data. The described race is associated with removing a DWC3 gadget while delayed nostream work may be pending, so avoiding that condition may reduce exposure, but this is not documented as a complete workaround.

4

How can I determine whether a kernel includes the fix?

Check whether dwc3_gadget_free_endpoints cancels each endpoint's nostream_work before freeing the endpoint structure with kfree(dep). The listed kernel stable references contain the corresponding fixes.

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