ZeroHour

CVE-2026-90022

large

Use-after-free in Linux kernel USB gadget MIDI 2.0 (f_midi2) driver

CVSS 3.1
7.8 high
EPSS
Published
()
Modified
AI analysis

The Linux kernel's f_midi2 USB gadget driver has a use-after-free in the configfs 'show' path for its string attributes: f_midi2_opts_str_show() takes the string lock internally, but its callers dereference the string pointer before that lock is taken. A local attacker who can concurrently read and write a gadget string attribute (interface name, block name, or endpoint string) can hit a race in which the store path frees the old string under the lock while the show path is still dereferencing it outside the lock. Exploitation could yield kernel memory disclosure or corruption; the CVSS 7.8 score (local vector, high confidentiality/integrity/availability impact) indicates potential local privilege escalation. Only systems that actually instantiate the f_midi2 USB gadget function via configfs — typically embedded audio/music hardware and Linux devices emulating a USB MIDI 2.0 device — are exposed. No exploitation in the wild, public proof-of-concept, or KEV listing is known.

What to do: Apply a kernel update containing the CVE-2026-90022 fix (or the vendor backport); the specific fixed release is not stated in the provided data, so track your distro's stable kernel advisories. Restrict configfs gadget attribute permissions to root and avoid untrusted local users on systems with f_midi2 gadget instances. Check whether you are exposed by looking for the f_midi2 module loaded or gadget instances configured under the kernel's usb_gadget configfs tree.

Affected
Linux kernel (usb: gadget f_midi2 driver)
Estimated exposure
largeplausibly hundreds of thousands of Linux systems ship the f_midi2 driver, with on the order of tens of thousands actively running MIDI 2.0 gadget configurations — f_midi2 is built into/modules available in mainstream kernels that ship the USB gadget MIDI 2.0 function, but the flaw is only reachable where the gadget is instantiated via configfs — a deployment pattern seen in pro-audio/embedded music…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_midi2: fix use-after-free in string attribute show path f_midi2_opts_str_show() takes the string lock internally, but its callers dereference the opts->info. 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.

Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

In the news

No ingested article mentions this CVE yet.