CVE-2025-21835: Linux kernel · usb: gadget: f_midi: fix MIDI
Affects Linux kernelSource GCVE Database
Not known to be exploited · CVSS 5.5 Medium · fixed in 5.4.0-1146.156~18.04.1 : update Linux kernel when convenient.
Data as of 28 Oct 2026, 11:14 UTC
- Patch
- Available – fixed in 5.4.0-1146.156~18.04.1, 5.4.0-1151.158~18.04.1, 5.4.0-1149.158~18.04.1 +83
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HExploitation evidence
Disclosed: evidence found.
CVE published 7 Mar 2025
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade to a fixed release listed under Affected software.
Patches and advisories
- ubuntu.com/security/notices/USN-7510-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-7511-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7511-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-7512-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7516-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7516-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-7517-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7518-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7521-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-3 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-4 (opens in a new tab)
Affected software
| Product | Affected | Fixed in |
|---|---|---|
Ubuntu 24.04 LTSlinuxpkg:deb/ubuntu/linux?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Ubuntu 24.04 LTSlinux-awspkg:deb/ubuntu/linux-aws?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Ubuntu 24.04 LTSlinux-azurepkg:deb/ubuntu/linux-azure?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Ubuntu 24.04 LTSlinux-azure-6.11pkg:deb/ubuntu/linux-azure-6.11?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Ubuntu 24.04 LTSlinux-azure-nvidiapkg:deb/ubuntu/linux-azure-nvidia?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Ubuntu 24.04 LTSlinux-gcppkg:deb/ubuntu/linux-gcp?arch=source&distro=nobleOther threats | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
Description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_midi: fix MIDI Streaming descriptor lengths While the MIDI jacks are configured correctly, and the MIDIStreaming endpoint descriptors are filled with the correct information, bNumEmbMIDIJack and bLength are set incorrectly in these descriptors. This does not matter when the numbers of in and out ports are equal, but when they differ the host will receive broken descriptors with uninitialized stack memory leaking into the descriptor for whichever value is smaller. The precise meaning of "in" and "out" in the port counts is not clearly defined and can be confusing. But elsewhere the driver consistently uses this to match the USB meaning of IN and OUT viewed from the host, so that "in" ports send data to the host and "out" ports receive data from it.
References
- ubuntu.com/security/CVE-2025-21835 (opens in a new tab)
- cve.org/CVERecord?id=CVE-2025-21835 (opens in a new tab)
- git.kernel.org/linus/da1668997052ed1cb00322e1f3b63702615c9429 (opens in a new tab)
- git.kernel.org/stable/c/6ae6dee9f005a2f3b739b85abb6f14a0935699e0 (opens in a new tab)
- git.kernel.org/stable/c/6b16761a928796e4b49e89a0b1ac284155172726 (opens in a new tab)
- git.kernel.org/stable/c/9f6860a9c11301b052225ca8825f8d2b1a5825bf (opens in a new tab)
- git.kernel.org/stable/c/a2d0694e1f111379c1efdf439dadd3cfd959fe9d (opens in a new tab)
- git.kernel.org/stable/c/da1668997052ed1cb00322e1f3b63702615c9429 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-7511-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7511-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-7512-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7516-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7516-2 (opens in a new tab)
- ubuntu.com/security/notices/USN-7517-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7518-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7521-1 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-3 (opens in a new tab)
- ubuntu.com/security/notices/USN-7510-4 (opens in a new tab)