CVE-2024-26748: usb: cdns3: fix memory double free when handle zero packet
In the Linux kernel, the following vulnerability has been resolved:
usb: cdns3: fix memory double free when handle zero packet
829 if (request->complete) {
830 spin_unlock(&priv_dev->lock);
831 usb_gadget_giveback_request(&priv_ep->endpoint,
832 request);
833 spin_lock(&priv_dev->lock);
834 }
835
836 if (request->buf == priv_dev->zlp_buf)
837 cdns3_gadget_ep_free_request(&priv_ep->endpoint, request);
Driver append an additional zero packet request when queue a packet, which
length mod max packet size is 0. When transfer complete, run to line 831,
usb_gadget_giveback_request() will free this requestion. 836 condition is
true, so cdns3_gadget_ep_free_request() free this request again.
Log:
[ 1920.140696][ T150] BUG: KFENCE: use-after-free read in cdns3_gadget_giveback+0x134/0x2c0 [cdns3]
[ 1920.140696][ T150]
[ 1920.151837][ T150] Use-after-free read at 0x000000003d1cd10b (in kfence-#36):
[ 1920.159082][ T150] cdns3_gadget_giveback+0x134/0x2c0 [cdns3]
[ 1920.164988][ T150] cdns3_transfer_completed+0x438/0x5f8 [cdns3]
Add check at line 829, skip call usb_gadget_giveback_request() if it is
additional zero length packet request. Needn't call
usb_gadget_giveback_request() because it is allocated in this driver.
Security readout for executives and security teams
Plain-English summary
A flaw in the Linux Cdns3 USB gadget driver can free the same memory twice while processing an internally added zero-length packet. This may corrupt kernel memory, crash the system, or potentially compromise confidentiality and integrity. The CVSS score is 7.8, but exposure depends on the affected driver and transfer path being present and used.
Executive priority
Treat this as an urgent kernel maintenance issue on systems actively using Cdns3 USB gadget functionality. The potential impact is system-level, but the cited evidence indicates local rather than remote access and does not establish active exploitation. Systems without the relevant driver path should receive lower priority after exposure is verified.
Technical view
When a transfer length is an exact multiple of the endpoint maximum packet size, Cdns3 adds a zero-length packet request. Completion handling passed that request to usb_gadget_giveback_request(), which freed it, then freed it again after recognizing the driver's zero-length buffer. The resulting double-free manifested as a KFENCE-reported use-after-free. Stable kernel commits prevent the first giveback for this internal request.
Likely exposure
The supplied record lists affected Linux releases from 5.4 through 6.8, including specified stable versions. Practical exposure is concentrated on systems using the Cdns3 USB gadget driver and the vulnerable zero-length-packet path. Version numbers alone may be unreliable because distributors backport kernel fixes; confirm against the running vendor kernel and its advisory or changelog.
Exploitation context
The CVSS vector describes a local, low-complexity attack requiring low privileges and no user interaction, with potentially high confidentiality, integrity, and availability impact. The bundle marks this CVE as absent from KEV, and no cited source establishes active exploitation or a public exploit. The evidence demonstrates a reproducible memory-safety failure, not confirmed weaponization.
Researcher notes
The fix distinguishes the driver's internally allocated zero-length request from ordinary completed requests. It skips usb_gadget_giveback_request() for that internal request, preventing the first free before cdns3_gadget_ep_free_request(). The bundle supplies several stable-branch commits but does not provide a complete distribution-by-distribution fixed-version matrix or evidence that the memory corruption has been converted into reliable privilege escalation.
Mitigation direction
Install a vendor kernel containing the applicable cited stable fix.
Reboot affected systems into the updated kernel and verify it is running.
Prioritize systems that actively use the Cdns3 USB gadget driver.
Consult distribution guidance because fixed code may be backported without changing the upstream version pattern.
Validation and detection
Inventory running kernel versions on systems where Cdns3 USB gadget functionality may be used.
Determine whether the Cdns3 gadget driver and relevant hardware path are active.
Verify the running kernel contains the corresponding stable fix or documented vendor backport.
Review kernel logs for Cdns3 use-after-free or KFENCE signatures; their absence does not establish safety.
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-2024-26748 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.
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.