In the Linux kernel, the following vulnerability has been resolved: usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler The OTG… (CVE-2026-64347)
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler The OTG branch of composite_setup() falls back to the first configuration when none is selected: if (cdev->config) config = cdev->config; else config = list_first_entry(&cdev->configs, struct usb_configuration, list); if (!config) goto done; ... memcpy(req->buf, config->descriptors[0], value); list_first_entry() never returns NULL. On an empty list it returns container_of() of the list head. So the "if (!config)" check is dead. When cdev->configs is empty, config points at the head inside struct usb_composite_dev. config->descriptors[0] reads whatever sits at that offset. The memcpy copies up to w_length bytes of it into the response buffer. cdev->configs can be empty in two cases. One is a teardown race on gadget unbind with a control transfer in flight. The other is a driver that sets is_otg before it adds a config. A reproducer that holds cdev->configs empty triggers a KASAN fault in this branch. Use list_first_entry_or_null() so the existing check does its job.
AI Analysis
Technical Summary
The Linux kernel USB gadget composite driver had a vulnerability where the OTG branch of composite_setup() used list_first_entry() to get the first configuration entry without properly checking if the list was empty. Since list_first_entry() never returns NULL, the subsequent check for a NULL configuration was ineffective, leading to potential reading and copying of invalid memory from config->descriptors[0]. This occurs when cdev->configs is empty, such as during a teardown race with a control transfer in flight or when a driver sets is_otg before adding a configuration. The issue was fixed by changing to list_first_entry_or_null(), enabling the NULL check to function correctly and preventing invalid memory access.
Potential Impact
The vulnerability can cause the kernel to read and copy invalid memory during USB control transfers, potentially leading to kernel memory corruption or faults such as KASAN errors. This may result in system instability or crashes. There is no indication of remote code execution or privilege escalation from the provided data.
Mitigation Recommendations
A fix is available in the Linux kernel that replaces list_first_entry() with list_first_entry_or_null() in the USB_DT_OTG handler to properly handle empty configuration lists. Users should apply the official kernel update or patch that includes this fix. Since this is a kernel-level issue, updating to the patched kernel version is the recommended remediation.
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler The OTG… (CVE-2026-64347)
Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler The OTG branch of composite_setup() falls back to the first configuration when none is selected: if (cdev->config) config = cdev->config; else config = list_first_entry(&cdev->configs, struct usb_configuration, list); if (!config) goto done; ... memcpy(req->buf, config->descriptors[0], value); list_first_entry() never returns NULL. On an empty list it returns container_of() of the list head. So the "if (!config)" check is dead. When cdev->configs is empty, config points at the head inside struct usb_composite_dev. config->descriptors[0] reads whatever sits at that offset. The memcpy copies up to w_length bytes of it into the response buffer. cdev->configs can be empty in two cases. One is a teardown race on gadget unbind with a control transfer in flight. The other is a driver that sets is_otg before it adds a config. A reproducer that holds cdev->configs empty triggers a KASAN fault in this branch. Use list_first_entry_or_null() so the existing check does its job.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Linux kernel USB gadget composite driver had a vulnerability where the OTG branch of composite_setup() used list_first_entry() to get the first configuration entry without properly checking if the list was empty. Since list_first_entry() never returns NULL, the subsequent check for a NULL configuration was ineffective, leading to potential reading and copying of invalid memory from config->descriptors[0]. This occurs when cdev->configs is empty, such as during a teardown race with a control transfer in flight or when a driver sets is_otg before adding a configuration. The issue was fixed by changing to list_first_entry_or_null(), enabling the NULL check to function correctly and preventing invalid memory access.
Potential Impact
The vulnerability can cause the kernel to read and copy invalid memory during USB control transfers, potentially leading to kernel memory corruption or faults such as KASAN errors. This may result in system instability or crashes. There is no indication of remote code execution or privilege escalation from the provided data.
Mitigation Recommendations
A fix is available in the Linux kernel that replaces list_first_entry() with list_first_entry_or_null() in the USB_DT_OTG handler to properly handle empty configuration lists. Users should apply the official kernel update or patch that includes this fix. Since this is a kernel-level issue, updating to the patched kernel version is the recommended remediation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-f6gg-fr3w-rqh2
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-64347"]
- Ecosystems
- []
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a65420c9c2644c7f8085080
Added to database: 07/25/2026, 23:09:00 UTC
Last enriched: 07/25/2026, 23:32:32 UTC
Last updated: 09/07/2026, 10:52:10 UTC
Views: 44
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.