CVE-2024-40927

7.8 HIGH

📋 TL;DR

A use-after-free vulnerability in the Linux kernel's xHCI driver allows attackers to cause system crashes or potentially execute arbitrary code. This affects Linux systems using USB 3.x devices with multiple streams, particularly when handling read errors on storage devices. The vulnerability can lead to kernel panics, IOMMU faults, or memory corruption.

💻 Affected Systems

Products:
  • Linux kernel
Versions: Versions from when stream support was added (around 2010) up to fix commits
Operating Systems: Linux distributions using affected kernel versions
Default Config Vulnerable: ⚠️ Yes
Notes: Requires USB 3.x devices with multiple streams support, particularly UAS storage devices. Most vulnerable when handling read errors.

📦 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 crash leading to denial of service, potential arbitrary code execution in kernel context, or system instability requiring reboot.

🟠

Likely Case

System crashes or hangs when USB devices encounter errors, particularly with UAS storage devices during read failures.

🟢

If Mitigated

Reduced risk of crashes but potential performance impact on USB operations.

🌐 Internet-Facing: LOW - Requires local access or USB device interaction.
🏢 Internal Only: MEDIUM - Can be triggered by users with USB device access or through storage operations.

🎯 Exploit Status

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

Exploitation requires triggering specific USB error conditions with multiple streams. Reproducible with hdparm marking bad sectors and reading devices in loop.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Kernel versions with commits 26460c1afa31, 5ceac4402f5d, 61593dc413c3, 633f72cb6124, or 949be4ec5835

Vendor Advisory: https://git.kernel.org/stable/c/26460c1afa311524f588e288a4941432f0de6228

Restart Required: Yes

Instructions:

1. Update Linux kernel to patched version. 2. Check kernel version with 'uname -r'. 3. Reboot system after update. 4. Verify fix with 'dmesg | grep -i xhci' for absence of related warnings.

🔧 Temporary Workarounds

Disable USB 3.x multiple streams

linux

Prevent use of multiple streams feature in xHCI driver

echo 0 > /sys/module/xhci_hcd/parameters/streams

Avoid UAS devices

linux

Use USB storage in BOT mode instead of UAS

modprobe -r uas
modprobe usb-storage quirks=0xXXXX:0xXXXX:u

🧯 If You Can't Patch

  • Monitor system logs for xhci_warn messages and USB-related crashes
  • Restrict USB device access to trusted users only

🔍 How to Verify

Check if Vulnerable:

Check kernel version with 'uname -r' and compare with affected versions. Monitor 'dmesg | grep -i xhci' for warnings about multiple streams.

Check Version:

uname -r

Verify Fix Applied:

After patching, verify kernel version and check that USB operations with error conditions don't cause crashes. Run 'dmesg | grep -i "xhci.*stream"' for absence of warnings.

📡 Detection & Monitoring

Log Indicators:

  • xhci_warn messages about multiple streams
  • Kernel panic/Oops related to xhci
  • IOMMU fault errors
  • USB device disconnection errors

Network Indicators:

  • N/A - local vulnerability

SIEM Query:

source="kernel" AND ("xhci" OR "USB") AND ("panic" OR "Oops" OR "warning")

🔗 References

📤 Share & Export