CVE-2025-40314: Linux kernel · usb: cdns3: gadget: Use-after-free during failed initialization and exit of cdnsp gadget
Source GCVE Database
Not known to be exploited.
Data as of 25 Nov 2026, 21:38 UTC
Rated High by Threat Radar's AI analysis · No CVSS score from NVD or the CNA
Exploitation evidence
Disclosed: evidence found.
CVE published 8 Dec 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: 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 25 Nov 2026.
What to do
AI-suggested
A fix for this vulnerability has been implemented by modifying the order of freeing the gadget structure and its endpoints. Users should apply the official Linux kernel patches that address this issue. Since no specific patch links or fixed versions are provided, users should consult the Linux kernel vendor advisories or source repositories for the relevant updates.
Description
A use-after-free vulnerability exists in the Linux kernel's cdns3 USB gadget driver during failed initialization and exit of the cdnsp gadget. The gadget structure is freed before its endpoints, leaving dangling pointers that cause use-after-free when endpoints are freed later. This flaw has been resolved by changing the order of freeing operations to ensure endpoints are freed before the gadget structure.
References
- nvd.nist.gov/vuln/detail/CVE-2025-40314 (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)