CVE-2025-40314: Linux kernel · usb: cdns3: gadget: Use-after-free during failed initialization and exit of cdnsp gadget
Affects Linux kernelSource GCVE Database
Not known to be exploited · fixed in 5.15.0-1103.110~20.04.1 : update Linux kernel when convenient.
Data as of 26 Oct 2026, 13:47 UTC
Rated by Threat Radar · No CVSS score from NVD or the CNA
- EPSS
- 0.1% chance of exploitation in 30 days – higher than 8% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 5.15.0-1103.110~20.04.1, 5.15.0-1110.119~20.04.1, 5.15.0-1114.123~20.04.1 +66
Exploitation evidence
Disclosed: evidence found.
CVE published 8 Dec 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade to a fixed release listed under Affected software.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Ubuntu 25.10linuxpkg:deb/ubuntu/linux@6.17.0-14.14?arch=source&distro=questingOther threats | Affected
| Fixed in
|
Ubuntu 25.10linux-awspkg:deb/ubuntu/linux-aws@6.17.0-1007.7?arch=source&distro=questingOther threats | Affected
| Fixed in
|
Ubuntu 25.10linux-azurepkg:deb/ubuntu/linux-azure@6.17.0-1008.8?arch=source&distro=questingOther threats | Affected
| Fixed in
|
Ubuntu 25.10linux-azure-fdepkg:deb/ubuntu/linux-azure-fde@6.17.0-1017.17?arch=source&distro=questingOther threats | Affected
| Fixed in– |
Ubuntu 25.10linux-gcppkg:deb/ubuntu/linux-gcp@6.17.0-1007.7?arch=source&distro=questingOther threats | Affected
| Fixed in
|
Ubuntu 25.10linux-oraclepkg:deb/ubuntu/linux-oracle@6.17.0-1007.7?arch=source&distro=questingOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
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").
References
- ubuntu.com/security/CVE-2025-40314 (opens in a new tab)
- cve.org/CVERecord?id=CVE-2025-40314 (opens in a new tab)
- git.kernel.org/linus/87c5ff5615dc0a37167e8faf3adeeddc6f1344a3 (opens in a new tab)
- git.kernel.org/stable/c/0cf9a50af91fbdac3849f8d950e883a3eaa3ecea (opens in a new tab)
- git.kernel.org/stable/c/37158ce6ba964b62d1e3eebd11f03c6900a52dd1 (opens in a new tab)
- git.kernel.org/stable/c/87c5ff5615dc0a37167e8faf3adeeddc6f1344a3 (opens in a new tab)
- git.kernel.org/stable/c/9c52f01429c377a2d32cafc977465f37b5384f77 (opens in a new tab)
- git.kernel.org/stable/c/ea37884097a0931abb8e11e40eacfb25e9fdb5e9 (opens in a new tab)
- git.kernel.org/stable/c/fdf573c517627a96f5040f988e9b21267806be5c (opens in a new tab)
- ubuntu.com/security/notices/USN-8029-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-8030-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-8029-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-8048-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-8029-3 (opens in a new tab)
- ubuntu.com/security/notices/USN-8095-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-8096-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-8100-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-8095-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-8096-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-8095-3 (opens in a new tab)