CVE-2025-21859

5.5 MEDIUM

📋 TL;DR

A race condition in the Linux kernel's USB MIDI gadget driver can cause a deadlock when USB MIDI functionality is used. This affects systems using USB gadget mode with MIDI support, potentially causing denial of service. The vulnerability requires local access to trigger.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Specific affected versions not explicitly stated in CVE, but patches exist in stable kernel trees. Likely affects multiple kernel versions before fixes were backported.
Operating Systems: Linux distributions using vulnerable kernel versions
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when USB gadget mode with MIDI support (CONFIG_USB_GADGET, CONFIG_USB_F_MIDI) is enabled and actively used. Many systems don't enable this by default.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Kernel deadlock leading to system freeze or crash requiring hard reboot, causing denial of service on affected systems.

🟠

Likely Case

Local denial of service when USB MIDI gadget functionality is actively used, potentially freezing the affected USB gadget interface.

🟢

If Mitigated

Minimal impact if USB gadget mode with MIDI support is not enabled or used.

🌐 Internet-Facing: LOW - Requires local access to USB gadget interface, not directly exploitable over network.
🏢 Internal Only: MEDIUM - Local users or processes with USB gadget access could cause denial of service on affected systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Requires local access and ability to trigger USB MIDI gadget operations. Exploitation would cause denial of service rather than privilege escalation.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Multiple stable kernel versions with fixes: 1f10923404705a94891e612dff3b75e828a78368, 24a942610ee9bafb2692a456ae850c5b2e409b05, 4ab37fcb42832cdd3e9d5e50653285ca84d6686f, 727dee0857946b85232526de4f5a957fe163e89a, 8aa6b4be1f4efccbfc533e6ec8841d26e4fa8dba

Vendor Advisory: https://git.kernel.org/stable/c/1f10923404705a94891e612dff3b75e828a78368

Restart Required: Yes

Instructions:

1. Update to a patched kernel version from your distribution's repositories. 2. Reboot the system to load the new kernel. 3. Verify the fix is applied by checking kernel version or confirming USB MIDI gadget functionality works without deadlocks.

🔧 Temporary Workarounds

Disable USB MIDI gadget support

linux

Disable the vulnerable USB MIDI gadget module if not needed

echo 'blacklist g_midi' >> /etc/modprobe.d/blacklist.conf
rmmod g_midi 2>/dev/null || true

Disable USB gadget functionality

linux

Completely disable USB gadget support if not required

echo 'blacklist usb_f_midi' >> /etc/modprobe.d/blacklist.conf
rmmod usb_f_midi 2>/dev/null || true

🧯 If You Can't Patch

  • Disable USB gadget mode with MIDI support via kernel configuration or module blacklisting
  • Restrict local access to systems where USB gadget functionality is required

🔍 How to Verify

Check if Vulnerable:

Check if USB MIDI gadget module is loaded: lsmod | grep -E 'g_midi|usb_f_midi'

Check Version:

uname -r

Verify Fix Applied:

Check kernel version against patched versions from distribution vendor, or test USB MIDI gadget functionality for deadlocks

📡 Detection & Monitoring

Log Indicators:

  • Kernel panic messages
  • System freeze/crash logs
  • USB gadget related error messages in dmesg

Network Indicators:

  • None - local vulnerability only

SIEM Query:

source="kernel" AND ("deadlock" OR "USB MIDI" OR "f_midi" OR "g_midi")

🔗 References

📤 Share & Export