CVE-2026-64346 json
usb: gadget: udc: Fix use-after-free in gadget_match_driver
published 2026-07-25 3 mo ago modified 2026-11-06 2 d ago also EUVD-2026-48890
- cvss
- 7.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 5%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- Linux Linux 6.1.178, 6.6.145, 6.12.96, 6.18.39, 7.1.4, 7.2
- linux Debian 12 6.1.180-1
- linux Debian 13 6.12.96-1
- linux Debian 14 7.1.4-1
- linux-6.12 Debian 12 6.12.100-1~deb12u1
debian advisories DEBIAN-CVE-2026-64346
- linux Ubuntu 24.04 LTS 6.8.0-147.147
- linux Ubuntu 26.04 LTS 7.0.0-31.31
- linux-aws Ubuntu 24.04 LTS 6.8.0-1067.70
- linux-aws Ubuntu 26.04 LTS 7.0.0-1012.12
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1071.79
- linux-gcp Ubuntu 26.04 LTS 7.0.0-1011.11
- linux-gke Ubuntu 24.04 LTS 6.8.0-1066.74
- linux-gke Ubuntu 26.04 LTS 7.0.0-1006.7
ubuntu advisories UBUNTU-CVE-2026-64346
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-64kb SLE Module for Basesystem 15 SP7 6.4.0-150700.53.81.1
- kernel-syms SLE Module for Development Tools 15 SP7 6.4.0-150700.53.81.1
- kernel-azure SLE Module for Public Cloud 15 SP7 6.4.0-150700.53.81.1
- kernel-source SLE Module for Development Tools 15 SP7, SLE Module for Basesystem 15 SP7 6.4.0-150700.53.81.1
- kernel-default SLE Workstation Extension 15 SP7, SLE Module for Legacy 15 SP7, SLE Module for Basesystem 15 SP7 +2 more 6.4.0-150700.53.81.1
- kernel-zfcpdump SLE Module for Basesystem 15 SP7 6.4.0-150700.53.81.1
- kernel-obs-build SLE Module for Development Tools 15 SP7 6.4.0-150700.53.81.1
- kernel-default-base SLE Module for Basesystem 15 SP7 6.4.0-150700.53.81.1.150700.17.45.1
suse advisories SUSE-SU-2026:4254-1SUSE-SU-2026:23887-1SUSE-SU-2026:23902-1SUSE-SU-2026:23897-1SUSE-SU-2026:23881-1SUSE-SU-2026:4120-1
- kernel-rt openSUSE Leap 16.0 6.12.0-160000.38.1
- dtb-aarch64 openSUSE Leap 16.0 6.12.0-160000.38.1
- kernel-64kb openSUSE Leap 16.0 6.12.0-160000.38.1
- kernel-syms openSUSE Leap 16.0 6.12.0-160000.38.1
- kernel-azure openSUSE Leap 16.0 6.12.0-160000.38.1
- kernel-obs-qa openSUSE Leap 16.0 6.12.0-160000.38.1
- kernel-source openSUSE Leap 16.0 6.12.0-160000.38.1
- kernel-default openSUSE Leap 16.0 6.12.0-160000.38.1
opensuse advisories openSUSE-SU-2026:21910-1openSUSE-SU-2026:11476-1
- git.kernel.org/stable/c/50eeb8e8a4f389efc91b93cff14a683e714ec194 commit
- git.kernel.org/stable/c/7a5214dae906d9f58e07bc4995e8181ee74439f4 commit
- git.kernel.org/stable/c/d026f71df141c9b064ff32a78af5391a31ef75c2 commit
- git.kernel.org/stable/c/b52476a83d9e12df00765359d728a875b128bef1 commit
- git.kernel.org/stable/c/54fa390aae393eb130f307a85562e3001cc39a52 commit
- git.kernel.org/stable/c/67e511d2989eb1c8c588b599ce2fcc6bb8e6f7ea commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-64346 updated cvss 4.7
kernel: usb: gadget: udc: Fix use-after-free in gadget_match_driver
-
Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernelaffected: workaround, no fix available “Fix deferred”
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 d ago
Exploit prediction
0.16% chance of exploitation in the next 30 days, higher than 5% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
-
git.kernel.org
/stable/c/50eeb8e8a4f389efc91b93cff14a683e714ec194
patch
-
git.kernel.org
/stable/c/7a5214dae906d9f58e07bc4995e8181ee74439f4
patch
-
git.kernel.org
/stable/c/d026f71df141c9b064ff32a78af5391a31ef75c2
patch
-
git.kernel.org
/stable/c/b52476a83d9e12df00765359d728a875b128bef1
patch
-
git.kernel.org
/stable/c/54fa390aae393eb130f307a85562e3001cc39a52
patch
-
git.kernel.org
/stable/c/67e511d2989eb1c8c588b599ce2fcc6bb8e6f7ea
patch
Sources
- CVE List CVE-2026-64346
- NVD CVE-2026-64346
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.