All vulnerabilities

Servers and applications

CVE-2026-142986

usb: gadget: f_midi: fix UAF race during IN request handling

Severity
Unrated
Published
3 Dec 2026
Last changed
3 Dec 2026
Added to UpHeron
3 Dec 2026
Fixed in
5.10.276, 5.15.227, 6.12.120, 6.18.66, 7.3.7
Sources
CVE Program

Description

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

f_midi_disable() drains and frees pre-allocated IN requests from in_req_fifo without holding midi->transmit_lock. If f_midi_transmit() runs concurrently on the workqueue, f_midi_do_transmit() can peek a request from in_req_fifo and write into its buffer while f_midi_disable() frees it, leading to a use-after-free.

Additionally, when usb_ep_queue() fails in f_midi_do_transmit() (such as with -ESHUTDOWN when the endpoint is disabled concurrently), it resets req->length = 0 and returns active instead of the error code, causing the do-while loop in f_midi_transmit() to keep spinning under midi->transmit_lock until the substream is drained.

Fix this by acquiring midi->transmit_lock in f_midi_disable() while releasing IN requests from in_req_fifo, and returning the error code from f_midi_do_transmit() when usb_ep_queue() fails so f_midi_transmit() aborts immediately and drops active substreams.

From the CVE Program.

Affected software

SoftwareAffected versions
Linux kernelServers and applications · cna:linux|linux
  • From 4.5 before 5.10.276
  • From 5.11 before 5.15.227
  • From 5.16 before 6.12.120
  • From 6.13 before 6.18.66
  • From 6.19 before 7.3.7

About Linux kernel

Unix-like operating system kernel, basis for all Linux operating systems

From Wikidata, CC0 1.0.
GitHub stars
257,106GitHub, 29 Nov 2026
Forks
66,781GitHub, 29 Nov 2026
Developer
Linus TorvaldsWikidata
License
GNU General Public License, version 2.0Wikidata
Written in
CWikidata
First released
25 Aug 1991Wikidata
First published on GitHub
4 Sept 2011GitHub

References

  • CVE.org https://www.cve.org/CVERecord?id=CVE-2026-142986