CVE-2025-40314
usb: cdns3: gadget: Use-after-free during failed initialization and exit of cdnsp gadget
Reported by linux · Published December 8, 2025
In the Linux kernel, the following vulnerability has been resolved: usb: cdns3: gadget: Use-after-free during failed initialization and exit of cdnsp gadget In the __cdnsp_gadget_init() and cdnsp_gadget_exit() functions, the gadget structure (pdev->gadget) was freed before its endpoints. The endpoints are linked via the ep_list in the gadget structure. Freeing the gadget first leaves dangling pointers in the endpoint list. When the endpoints are subsequently freed, this results in a use-after-free. Fix: By separating the usb_del_gadget_udc() operation into distinct "del" and "put" steps, cdnsp_gadget_free_endpoints() can be executed prior to the final release of the gadget structure with usb_put_gadget(). A patch similar to bb9c74a5bd14("usb: dwc3: gadget: Free gadget structure only after freeing endpoints").
EPSS 0.21% · 10.5th percentile
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| Linux | Linux | ea37884097a0931abb8e11e40eacfb25e9fdb5e9, 9c52f01429c377a2d32cafc977465f37b5384f77, 87c5ff5615dc0a37167e8faf3adeeddc6f1344a3 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 8bc1901ca7b07d864fca11461b3875b31f949765, 8bc1901ca7b07d864fca11461b3875b31f949765, 8bc1901ca7b07d864fca11461b3875b31f949765 |
| Linux | Linux | 5.3, 0, 5.15.197 |
| Linux | Linux | 6.6.117, 6.17.8, 6.18 |
| linux | linux_kernel | 5.3, 5.3, 5.3 |
Timeline
- Dec 7, 2025 CVE Published
- Dec 8, 2025 EPSS Score (30 in total, the first dated here)
- Mar 29, 2026 Distribution Patch (182 in total, the first dated here)
- Mar 29, 2026 Security Advisory (186 in total, the first dated here)
- Jun 8, 2026 Coalition ESS Score
- Oct 7, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-40314
vulnetix vdb fixes CVE-2025-40314
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-40314/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart