Skip to main content

Linux Kernel EUVDEUVD-2026-53771

| CVE-2026-64584 HIGH
2026-08-06 Linux GHSA-m3h2-47px-55rm
7.8
CVSS 3.1 · Vendor: Linux
Share

Severity by source

Vendor (Linux) PRIMARY
7.8 HIGH
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
7.0 HIGH

Race condition between ALSA trigger path and USB gadget unbind justifies AC:H; PR:L reflects low-privilege rawmidi device access required; C/I/A:H reflects kernel UAF impact.

3.1 AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
SUSE
6.4 MEDIUM
AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

Primary rating from Vendor (Linux).

CVSS VectorVendor: Linux

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

5
Analysis Generated
Aug 08, 2026 - 15:36 vuln.today
CVSS changed
Aug 08, 2026 - 15:22 NVD
7.8 (HIGH)
Patch available
Aug 06, 2026 - 08:16 EUVD
CVE Published
Aug 06, 2026 - 07:06 cve.org
HIGH 7.8
CVE Published
Aug 06, 2026 - 07:06 cve.org
UNKNOWN (no severity yet)

DescriptionCVE.org

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

usb: gadget: f_midi: cancel pending IN work before freeing the midi object

The f_midi driver embeds a work item (midi->work) whose handler, f_midi_in_work(), dereferences the enclosing struct f_midi through container_of(). This work is armed from two sites: f_midi_complete(), on a normal IN-endpoint completion, and f_midi_in_trigger(), on an ALSA rawmidi output-stream start.

Neither f_midi_disable() nor f_midi_unbind() cancels midi->work. f_midi_disable() only disables the endpoints and drains the in_req_fifo; it does not synchronize the work item, and the sound card is released asynchronously to the final free of the midi object.

The midi object is reference-counted (midi->free_ref) and is freed in f_midi_free() only once both the usb_function reference and the rawmidi private_data reference have been dropped. In f_midi_unbind(), f_midi_disable() runs before the sound card is released, so while the USB endpoints are already disabled the rawmidi device is still usable by an open substream. A concurrent userspace write on such a substream can reach f_midi_in_trigger() and queue midi->work again after f_midi_disable() has returned. A work item armed this way may still be pending when the last reference drops and f_midi_free() proceeds to kfree(midi), letting f_midi_in_work() dereference the struct after it has been freed, a use-after-free.

For this reason cancelling midi->work in f_midi_disable() would not be sufficient: the ALSA trigger path can rearm the work after disable() returns. Cancelling at the refcount-zero free site is the boundary after which neither arming source can survive, because by then both references that keep the midi object alive have been dropped: the USB endpoints are already disabled and the rawmidi device has been released.

Fix this by calling cancel_work_sync(&midi->work) in the refcount-zero block of f_midi_free(), before the embedded work_struct is freed along with the rest of the structure. opts->lock is a sleeping mutex, so calling cancel_work_sync() under it is permitted, and the handler takes midi->transmit_lock rather than opts->lock, so no self-deadlock can occur while it waits for a running instance of the work to finish.

This issue was found by an in-house static analysis tool.

AnalysisAI

Use-after-free in the Linux kernel's USB MIDI gadget driver (f_midi) exposes systems configured as USB MIDI gadgets to local privilege escalation or denial-of-service. The flaw stems from midi->work not being cancelled before struct f_midi is freed in f_midi_free(), allowing a concurrent ALSA rawmidi write via f_midi_in_trigger() to rearm the work item after f_midi_disable() returns but before the object is deallocated - causing f_midi_in_work() to dereference freed kernel memory. No public exploit has been identified and EPSS sits at 0.16% (5th percentile), but the CVSS 7.8 score and kernel-level impact make patching the correct priority on systems deploying USB gadget functionality.

Technical ContextAI

The f_midi driver (drivers/usb/gadget/function/f_midi.c) implements a USB MIDI gadget function and embeds a work_struct (midi->work) inside struct f_midi, with the handler f_midi_in_work() recovering the parent structure via container_of(). Two call sites can arm this work: f_midi_complete() on USB IN-endpoint completion, and f_midi_in_trigger() on ALSA rawmidi output-stream start. The object lifetime is managed by a reference counter (midi->free_ref) covering both the USB function reference and the rawmidi private_data reference. The root cause is a TOCTOU race: f_midi_disable() tears down USB endpoints without synchronizing the work queue, and the ALSA trigger path can rearm midi->work after disable() returns but before f_midi_free() drops the final reference and calls kfree(midi). Despite CWE being listed as N/A in source data, this is unambiguously CWE-416 (Use After Free). Affected CPE: cpe:2.3:a:linux:linux:*:*:*:*:*:*:*:*. The vulnerability was introduced from commit 8653d71ce3763aedcf3d2331f59beda3fecd79e4.

RemediationAI

Upgrade to a patched stable kernel: Linux 6.6.148, 6.12.101, 6.18.42, 7.1.6, or 7.2-rc5. Upstream fix commits are available at https://git.kernel.org/stable/c/380b4bef46c2eb260c7a9c6bb2c5be33ce5a38f9, https://git.kernel.org/stable/c/87bc316dd6fc90072297c635e10b9aa6075ecda1, https://git.kernel.org/stable/c/f45089eaad0a083d71d84ff175741d7e157d9b69, https://git.kernel.org/stable/c/ac9a51d910bb7465c554c45320cb6c09f3d0b49d, and https://git.kernel.org/stable/c/5650c18d93a1db7e27cb5a40b394747eb4686d5b. For systems that cannot be immediately upgraded, removing or blacklisting the usb_f_midi kernel module ('modprobe -r usb_f_midi' or adding it to /etc/modprobe.d/blacklist.conf) eliminates the attack surface entirely, at the cost of USB MIDI gadget functionality. Alternatively, restricting access to ALSA rawmidi device nodes (/dev/snd/midiC*D*) to root-only or a dedicated group via udev rules reduces exploitation risk by eliminating the low-privilege trigger path, while preserving USB MIDI gadget operation for authorized system services.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
openSUSE Tumbleweed Fixed
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected

Share

EUVD-2026-53771 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy