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.
Published: 2026-07-25
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability occurs in the Linux kernel’s USB gadget OTG composite driver. The code assumes that the configuration list will never be empty, but when it is, the list_first_entry function returns the list head instead of a valid configuration. This leads the code to read from an unexpected offset in the usb_composite_dev structure; accessing config->descriptors[0] therefore triggers an out-of-bounds read into the response buffer sent to a USB host. The result can expose kernel memory contents to a local attacker, representing a potential local information disclosure.

Affected Systems

Any Linux kernel build that includes the OTG composite driver is affected. No specific version numbers are listed, so the flaw may exist in any kernel revision that has not incorporated the patch described in the advisory commit history.

Risk and Exploitability

The CVSS score of 5.5 indicates a medium-level severity. The EPSS score is less than 1 % and the vulnerability is not listed in CISA KEV, indicating a low probability of exploitation in the wild. Based on the description, it is inferred that the attacker would need local or privileged access to load a malicious USB gadget driver or to trigger a race condition during gadget teardown, a scenario that is highly constrained. The vulnerability does not provide remote code execution and the primary impact is limited to a local kernel memory read.

Generated by OpenCVE AI on August 2, 2026 at 13:14 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the kernel patch that replaces list_first_entry with list_first_entry_or_null in the OTG handler; this is the official fix.
  • Ensure that any USB gadget drivers set the is_otg flag only after adding a configuration, to avoid the race condition that leaves the configuration list empty.
  • If an immediate kernel update is not possible, disable USB OTG gadget functionality via kernel configuration options or unload the relevant gadget modules to mitigate the risk.

Generated by OpenCVE AI on August 2, 2026 at 13:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4717-1 linux security update
Debian DLA Debian DLA DLA-4720-1 linux security update
Debian DLA Debian DLA DLA-4723-1 linux-6.1 security update
Debian DLA Debian DLA DLA-4724-1 linux-6.12 new package
History

Thu, 30 Jul 2026 12:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Moderate


Mon, 27 Jul 2026 06:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-125

Sat, 25 Jul 2026 09:30:00 +0000

Type Values Removed Values Added
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.
Title usb: gadget: composite: fix dead empty check in the USB_DT_OTG handler
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-07-25T08:50:08.338Z

Reserved: 2026-07-19T15:36:31.782Z

Link: CVE-2026-64347

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-07-25T10:17:16.893

Modified: 2026-08-11T15:00:57.447

Link: CVE-2026-64347

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-25T00:00:00Z

Links: CVE-2026-64347 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-02T13:15:03Z

Weaknesses