Linux Kernel up to 7.2-rc4 usb gadget f_midi f_midi_free use after free

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
7.8$0-$5k1.82

Summaryinfo

A vulnerability was found in Linux Kernel up to 6.6.147/6.12.100/6.18.41/7.1.5/7.2-rc4. It has been classified as very critical. This issue affects the function f_midi_free of the component usb gadget f_midi. The manipulation leads to use after free. This vulnerability is traded as CVE-2026-64584. An attack has to be approached locally. There is no exploit available.

Detailsinfo

A vulnerability, which was classified as very critical, has been found in Linux Kernel up to 6.6.147/6.12.100/6.18.41/7.1.5/7.2-rc4. This issue affects the function f_midi_free of the component usb gadget f_midi. The manipulation with an unknown input leads to a use after free vulnerability. Using CWE to declare the problem leads to CWE-416. Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code. Impacted is confidentiality, integrity, and availability. The summary by CVE is:

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.

The advisory is shared at git.kernel.org. The identification of this vulnerability is CVE-2026-64584 since 07/19/2026. The exploitation is known to be easy. An attack has to be approached locally. Additional levels of successful authentication are needed for exploitation. Technical details are known, but no exploit is available. The price for an exploit might be around USD $0-$5k at the moment (estimation calculated on 08/06/2026).

Upgrading to version 6.6.148, 6.12.101, 6.18.42, 7.1.6 or 7.2-rc5 eliminates this vulnerability. Applying the patch 380b4bef46c2eb260c7a9c6bb2c5be33ce5a38f9/87bc316dd6fc90072297c635e10b9aa6075ecda1/f45089eaad0a083d71d84ff175741d7e157d9b69/ac9a51d910bb7465c554c45320cb6c09f3d0b49d/5650c18d93a1db7e27cb5a40b394747eb4686d5b is able to eliminate this problem.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Productinfo

Type

Vendor

Name

Version

License

Website

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 8.2
VulDB Meta Temp Score: 7.8

VulDB Base Score: 8.2
VulDB Temp Score: 7.8
VulDB Vector: 🔒
VulDB Reliability: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔒
VulDB Temp Score: 🔒
VulDB Reliability: 🔍

Exploitinginfo

Class: Use after free
CWE: CWE-416 / CWE-119
CAPEC: 🔒
ATT&CK: 🔒

Physical: Partially
Local: Yes
Remote: No

Availability: 🔒
Status: Not defined
Price Prediction: 🔍
Current Price Estimation: 🔒

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Upgrade
Status: 🔍

0-Day Time: 🔒

Upgrade: Kernel 6.6.148/6.12.101/6.18.42/7.1.6/7.2-rc5
Patch: 380b4bef46c2eb260c7a9c6bb2c5be33ce5a38f9/87bc316dd6fc90072297c635e10b9aa6075ecda1/f45089eaad0a083d71d84ff175741d7e157d9b69/ac9a51d910bb7465c554c45320cb6c09f3d0b49d/5650c18d93a1db7e27cb5a40b394747eb4686d5b

Timelineinfo

07/19/2026 CVE reserved
08/06/2026 +18 days Advisory disclosed
08/06/2026 +0 days VulDB entry created
08/06/2026 +0 days VulDB entry last update

Sourcesinfo

Vendor: kernel.org

Advisory: git.kernel.org
Status: Confirmed

CVE: CVE-2026-64584 (🔒)
GCVE (CVE): GCVE-0-2026-64584
GCVE (VulDB): GCVE-100-386489

Entryinfo

Created: 08/06/2026 09:37
Changes: 08/06/2026 09:37 (59)
Complete: 🔍
Cache ID: 216::103

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Want to stay up to date on a daily basis?

Enable the mail alert feature now!