Look up another CVE · open CVE-2026-90022 in the interactive tracker
CVE-2026-90022
usb: gadget: f_midi2: fix use-after-free in string attribute show path
Published 2026-09-16 (33 days ago) by the Linux kernel CNA. Subsystem drivers/usb. Debian urgency: unimportant.
What to do, per Debian release
Debian's own status for CVE-2026-90022 in every release this site tracks, and what each one means in practice. Every status below is the one the Debian Security Team publishes for this CVE. source
| Release | Status | Version | What this means |
|---|---|---|---|
| Debian 12bookworm | not affected | 6.1.190-1 | Nothing to do. bookworm never shipped the vulnerable code. |
| Debian 13trixie | fixedDSA-6528-1 · 2026-09-29 · text | 6.12.111-1 | Update the kernel and reboot. DSA-6528-1 shipped the fix on 2026-09-29, in 6.12.111-1. A running kernel keeps the old code until the machine restarts. |
| Debian 14forky | fixed | 7.2.6-1 | Update the kernel and reboot. Fixed in 7.2.6-1. A running kernel keeps the old code until the machine restarts. |
| Debian unstablesid | fixed | 7.2.6-1 | Update the kernel and reboot. Fixed in 7.2.6-1. A running kernel keeps the old code until the machine restarts. |
| Debian 12bookworm · linux-6.12 | fixedDLA-4817-1 · 2026-10-04 · text | 6.12.111-1~deb12u1 | Update the kernel and reboot. DLA-4817-1 shipped the fix on 2026-10-04, in 6.12.111-1~deb12u1. A running kernel keeps the old code until the machine restarts. |
The vulnerability
What the bug is
f_midi2_opts_str_show() takes the string lock internally, but its callers dereference the opts->info.<field> pointer before calling it, outside the lock. This races with f_midi2_opts_str_store(), which frees the old string under opts->lock when the attribute is written concurrently, the show path can read a pointer that gets freed before the lock inside str_show() is even taken. Change f_midi2_opts_str_show() to take a pointer to the string field, matching the existing pattern in f_midi2_opts_str_store(), and dereference it only after the lock is held. Update all three callers (iface_name, block name, and the EP string option macro) accordingly.
Where it lives
The fix touches these files. If the subsystem is one you do not use, the practical exposure is lower, though the package is still the vulnerable one.
drivers/usb/gadget/function/f_midi2.c
- What this is
- USB SUBSYSTEMMAINTAINERS section matched on drivers/usb/ · linux-usb@vger.kernel.org · Supported
Check it on the machine
grep -wE 'CONFIG_OF|CONFIG_PCI|CONFIG_USB|CONFIG_USB_F_MIDI2|CONFIG_USB_GADGET|CONFIG_USB_PHY|CONFIG_USB_SUPPORT' /boot/config-$(uname -r)Reads the booted kernel's own configuration, on the machine and nowhere else. =y is built in, =m is a module, and an is not set line means the code is not there.
Show whether Debian builds this, per release
Debian does not build this code in 4 releases. The build rule could not be established for 1 release, so nothing is claimed about those.
- bookworm?
- trixie, forky, sid, bookworm · linux-6.12n
- ?
- not established - no Makefile entry for the affected file
- n
- not enabled on any flavour - this release does not build the code
Where a release above reads "not established", no build rule for the affected file was found in that release's kernel tree. That is a gap in this lookup, not a finding that the code is absent.
- Build switches
- CONFIG_OF, CONFIG_PCI, CONFIG_USB, CONFIG_USB_F_MIDI2, CONFIG_USB_GADGET, CONFIG_USB_PHY, CONFIG_USB_SUPPORT
- Reads as
- all on means the file is compiled; any one off means it is not.
From the configuration Debian publishes for every kernel flavour it builds. It covers only the architectures Debian ships a linux-config package for, and nothing about a kernel you built yourself. Debian's own status above stays authoritative about the source package.MAINTAINERS kbuild Makefiles Debian linux-config packages
Signals
- Published
- 2026-09-16 (33 days ago)source
- CVSS
- 7.8 high
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:Hsource recompute it - Attack vector
- local (AV:L)source
- EPSS
- 0.17%, higher than 6.0% of all CVEssource
- CISA KEV
- not listedthe KEV catalogue
- Debian urgency
- unimportantsource
- Subsystem
- drivers/usb
Upstream fixes
The versions the CNA records as introducing and fixing this, and the commit for each. source
| Introduced | Fixed in | Commit |
|---|---|---|
| 6.6 | 6.6.157 | f9bdf4c4f641 |
| 6.6 | 6.12.110 | d11f3300b39e |
| 6.6 | 6.18.51 | e89e30f0b5d3 |
| 6.6 | 7.2.5 | 49fab5e1bdb2 |
| 6.6 | 7.3 | fed0aa7c6eae |
Debian advisories
| Advisory | Date | Shipped to | Debian |
|---|---|---|---|
| DLA-4817-1 | 2026-10-04 | bookworm 6.12.111-1~deb12u1 | tracker |
| DSA-6528-1 | 2026-09-29 | trixie 6.12.111-1 | tracker |
Why the CNA scored it this way
Quoted from the kernel CNA's own scoring file, word for word. A highlighted metric carries the most severe value CVSS v3.1 defines for it, which is what pushes the score up. source
- AV:LAttack vector, local
- The UAF is reached by concurrent local read/write of midi2 configfs string attributes (iface_name, ep_name, product_id, block name) under /sys/kernel/config/usb_gadget/<g>/functions/midi2.*; no USB host packets, cable, or UDC bind are required, matching other gadget configfs bugs scored Local rather than Physical.
- AC:LAttack complexity, low
- The attacker controls both sides by opening the same attribute on two fds (configfs serializes only per-fd) and racing show against store; store kfree()s the prior kstrndup string under opts->lock while show already holds the stale pointer, and the function need not be bound (store fails only if refcnt != 0).
- PR:LPrivileges required, low
- gadgets_make(), function_make(), and the midi2 show/store handlers perform no capable() check; access is gated only by configfs DAC, and Android/embedded USB gadget HALs routinely chown /sys/kernel/config/usb_gadget to non-root system or daemon accounts.
- UI:NUser interaction, none
- The attacker creates the midi2 function instance and performs the concurrent attribute read/write themselves; configfs is typically already mounted at /sys/kernel/config, and no victim mount, cable plug, or other-user action is required.
- S:UScope, unchanged
- The use-after-free of the configfs kstrndup string corrupts kernel heap within the same host kernel security authority; this is not a VM escape, sandbox breakout, or IOMMU/DMA boundary bypass.
- C:HConfidentiality impact, high
- Callers load opts->info.<field> outside the lock, then f_midi2_opts_str_show() scnprintfs that pointer after a concurrent store kfree()d it; reclaiming the kmalloc object lets the attacker control the bytes copied to userspace, a UAF disclosure primitive.
- I:HIntegrity impact, high
- The same UAF of the kstrndup string, with store spraying attacker-chosen size and content into the same slab, is a classic heap use-after-free that can be converted into overlapping objects, arbitrary write, and control-flow hijack.
- A:HAvailability impact, high
- scnprintf() of the freed string after kfree() reliably produces a KASAN slab-use-after-free oops or kernel panic, which the attacker can retrigger with further concurrent show/store loops.