CVE-2025-40092: usb: gadget: f_ncm: Refactor bind path to use __free()
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: f_ncm: Refactor bind path to use __free()
After an bind/unbind cycle, the ncm->notify_req is left stale. If a
subsequent bind fails, the unified error label attempts to free this
stale request, leading to a NULL pointer dereference when accessing
ep->ops->free_request.
Refactor the error handling in the bind path to use the __free()
automatic cleanup mechanism.
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
Call trace:
usb_ep_free_request+0x2c/0xec
ncm_bind+0x39c/0x3dc
usb_add_function+0xcc/0x1f0
configfs_composite_bind+0x468/0x588
gadget_bind_driver+0x104/0x270
really_probe+0x190/0x374
__driver_probe_device+0xa0/0x12c
driver_probe_device+0x3c/0x218
__device_attach_driver+0x14c/0x188
bus_for_each_drv+0x10c/0x168
__device_attach+0xfc/0x198
device_initial_probe+0x14/0x24
bus_probe_device+0x94/0x11c
device_add+0x268/0x48c
usb_add_gadget+0x198/0x28c
dwc3_gadget_init+0x700/0x858
__dwc3_set_mode+0x3cc/0x664
process_scheduled_works+0x1d8/0x488
worker_thread+0x244/0x334
kthread+0x114/0x1bc
ret_from_fork+0x10/0x20
Security readout for executives and security teams
Plain-English summary
A flaw in the Linux USB network gadget component can crash the kernel during a specific reconfiguration failure. Because a kernel crash can disrupt embedded devices, appliances, or systems using USB networking, affected deployments should update promptly. The supplied sources do not establish remote reachability or observed exploitation.
Executive priority
Prioritize affected embedded devices, appliances, and other systems using USB gadget NCM, especially where crashes interrupt critical services. Treat this as an urgent patching issue within that operational subset, not as evidence of broad internet exploitation. Confirm exposure before emergency action because the vulnerable path requires specific USB gadget configuration and lifecycle conditions.
Technical view
After an f_ncm bind/unbind cycle, notify_req can retain a stale request pointer. If a later bind fails, shared error cleanup passes that request to usb_ep_free_request, causing a NULL pointer dereference through the endpoint operations table. The referenced Linux stable commits refactor bind cleanup using __free().
Likely exposure
Exposure is most likely on Linux systems that enable the USB gadget NCM function and undergo bind, unbind, and subsequent failed-bind conditions. The supplied affected-version data spans multiple kernel branches but is insufficiently clear for reliable range-based conclusions; compare each deployed kernel with vendor advisories and the referenced stable commits.
Exploitation context
The CVSS 3.1 vector rates this as local, low-complexity, low-privilege, with no user interaction and high confidentiality, integrity, and availability impact. However, the description specifically demonstrates a kernel NULL-pointer crash. KEV is false, and the supplied sources provide no evidence of active exploitation or a public exploit.
Researcher notes
The stale notify_req survives unbind and is later freed through a failed bind cleanup path. The provided commit references appear to cover multiple stable branches, but the bundle does not map each commit to an explicit fixed release. The stated CVSS impact exceeds what the crash trace alone proves, so additional confidentiality or integrity consequences remain unsubstantiated here.
Mitigation direction
Install a vendor-supported kernel containing the applicable referenced stable fix.
Check Linux distribution or device-vendor guidance for fixed package versions.
Prioritize systems actively using the USB gadget NCM function.
Use vendor-recommended mitigations if immediate kernel replacement is unavailable.
Validation and detection
Inventory kernels on devices configured to provide USB NCM gadget networking.
Compare kernel builds against vendor fixed versions and the referenced stable commits.
Review kernel logs for ncm_bind or usb_ep_free_request NULL-pointer traces.
After updating, confirm the running kernel contains the applicable fix.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-40092 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
7Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.