Description
In the Linux kernel, the following vulnerability has been resolved:

usb: gadget: udc: Fix use-after-free in gadget_match_driver

The udc structure acts as the management structure for the gadget,
but their lifecycles are decoupled. A race condition exists where
usb_del_gadget() frees the udc memory (e.g., via mode-switch work)
while gadget_match_driver() concurrently accesses the freed udc memory
(e.g., via configfs), causing a Use-After-Free (UAF) that triggers a
NULL pointer dereference when the freed memory is zeroed:

[39430.908615][ T1171] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
[39430.911397][ T1171] pc : __pi_strcmp+0x20/0x140
[39430.911441][ T1171] lr : gadget_match_driver+0x34/0x60
...
[39430.911890][ T1171] usb_gadget_register_driver_owner+0x50/0xf8
[39430.911910][ T1171] gadget_dev_desc_UDC_store+0xf4/0x140
[39430.931308][ T1171] configfs_write_iter+0xec/0x134

[39430.957058][ T1171] Workqueue: events_freezable __dwc3_set_mode
[39430.957287][ T1171] dwc3_gadget_exit+0x34/0x8c
[39430.957304][ T1171] __dwc3_set_mode+0xc0/0x664

Fix this by ensuring the udc structure remains allocated until the
gadget is released. To achieve this, introduce a new
usb_gadget_release() routine to the core. When the gadget is added,
usb_add_gadget() stores the gadget's release routine in the udc
structure and takes a reference to the udc. When the gadget is
released, usb_gadget_release() drops the reference to the udc and
then calls the gadget's release routine.
Published: 2026-07-25
Score: 7.8 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a race condition that can trigger a use‑after‑free (CWE‑416) and a subsequent null pointer dereference (CWE‑476) when a USB gadget device is removed while its configuration is being altered via configfs. The UDC structure freed by usb_del_gadget() is zeroed, causing the kernel to dereference a null address, which results in a fatal kernel panic. The impact is a local denial of service, and based on the description, it is inferred that an attacker could potentially exploit the crash to achieve privilege escalation by manipulating the configuration during the removal process.

Affected Systems

All current Linux kernel releases that incorporate the USB gadget subsystem are affected until the code introducing usb_gadget_release() is applied. In particular, the version strings listed in the CPE data (Linux kernel 7.2 release candidates 1 and 2 as well as the generic kernel *) are known to contain the vulnerable code. Any distribution that ships with the same kernel source tree without the patch is vulnerable.

Risk and Exploitability

The CVSS score of 7.8 indicates high severity, but the EPSS score of less than 1% suggests a very low probability of real‑world exploitation. Based on the description, it is inferred that an attacker must have access to the USB gadget configuration via configfs while the device is being disconnected, effectively requiring local or privileged access. The vulnerability is not listed in the CISA KEV catalog, and exploitation would need the race condition to be triggered successfully against the vulnerable kernel release. The attack vector is therefore limited to environments where such access is possible, and the risk remains high but constrained to that scenario.

Generated by OpenCVE AI on September 3, 2026 at 21:00 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update the Linux kernel to a release that contains the usb_gadget_release() routine from the kernel maintainers.
  • If a kernel update cannot be applied immediately, disable USB gadget drivers or the configfs gadget interface until the patch is installed to prevent access to the vulnerable code paths.
  • After applying the patch, reboot the system to ensure all UDC structures are properly released, and resume normal operation.

Generated by OpenCVE AI on September 3, 2026 at 21:00 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
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, 03 Sep 2026 16:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416
CPEs cpe:2.3:o:linux:linux_kernel:7.2:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.2:rc2:*:*:*:*:*:*
Metrics 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'}

cvssV3_1

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


Sat, 01 Aug 2026 02:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Tue, 28 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476
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 05:15:00 +0000


Sun, 26 Jul 2026 02:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

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: udc: Fix use-after-free in gadget_match_driver The udc structure acts as the management structure for the gadget, but their lifecycles are decoupled. A race condition exists where usb_del_gadget() frees the udc memory (e.g., via mode-switch work) while gadget_match_driver() concurrently accesses the freed udc memory (e.g., via configfs), causing a Use-After-Free (UAF) that triggers a NULL pointer dereference when the freed memory is zeroed: [39430.908615][ T1171] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [39430.911397][ T1171] pc : __pi_strcmp+0x20/0x140 [39430.911441][ T1171] lr : gadget_match_driver+0x34/0x60 ... [39430.911890][ T1171] usb_gadget_register_driver_owner+0x50/0xf8 [39430.911910][ T1171] gadget_dev_desc_UDC_store+0xf4/0x140 [39430.931308][ T1171] configfs_write_iter+0xec/0x134 [39430.957058][ T1171] Workqueue: events_freezable __dwc3_set_mode [39430.957287][ T1171] dwc3_gadget_exit+0x34/0x8c [39430.957304][ T1171] __dwc3_set_mode+0xc0/0x664 Fix this by ensuring the udc structure remains allocated until the gadget is released. To achieve this, introduce a new usb_gadget_release() routine to the core. When the gadget is added, usb_add_gadget() stores the gadget's release routine in the udc structure and takes a reference to the udc. When the gadget is released, usb_gadget_release() drops the reference to the udc and then calls the gadget's release routine.
Title usb: gadget: udc: Fix use-after-free in gadget_match_driver
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-08-17T04:53:51.249Z

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

Link: CVE-2026-64346

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Analyzed

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

Modified: 2026-09-03T16:04:10.017

Link: CVE-2026-64346

cve-icon Redhat

Severity : Moderate

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

Links: CVE-2026-64346 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-03T21:15:04Z

Weaknesses