Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-40927 Overview
CVE-2024-40927 is a use-after-free vulnerability [CWE-416] in the Linux kernel's xHCI (Extensible Host Controller Interface) USB driver. The flaw occurs when multiple USB streams are active and an endpoint is stopped with several Transfer Descriptors (TDs) in flight. The driver fails to issue a Set TR Dequeue Pointer command for each affected stream, leaving stale TDs that reference DMA pages which may have been unmapped. Attackers with local access can trigger xHC crashes, Input-Output Memory Management Unit (IOMMU) faults, or silent memory corruption on systems without an IOMMU. The bug particularly affects USB Attached SCSI (UAS) devices during error handling.
Critical Impact
Local attackers can trigger kernel memory corruption or host controller crashes through USB error conditions, potentially leading to privilege escalation or denial of service.
Affected Products
- Linux Kernel versions prior to the fixed stable releases
- Linux Kernel 6.10-rc1, 6.10-rc2, 6.10-rc3
- Systems using xHCI with multi-stream USB devices (notably UAS storage)
Discovery Timeline
- 2024-07-12 - CVE-2024-40927 published to the National Vulnerability Database
- 2025-01 - Debian LTS security advisory published
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-40927
Vulnerability Analysis
The vulnerability resides in the xHCI driver's handling of cancelled Transfer Descriptors when multiple streams share an endpoint. When the host stops an endpoint, the driver must issue a Set TR Dequeue Pointer command for every stream containing active TDs. The original logic processed only the first stream, silently discarding subsequent TDs without clearing hardware caches. This leaves the host controller holding references to TDs whose associated DMA buffers may be freed and reused.
The bug originated in commit e9df17eb1408 when stream support was first added to the xHCI driver. Subsequent commits 674f8438c121 and 94f339147fc3 acknowledged the issue without resolving it. The fix defers additional TDs until the first is processed, then recursively calls xhci_invalidate_cancelled_tds() from xhci_handle_cmd_set_deq() to queue follow-up commands.
Root Cause
The root cause is improper lifecycle management of Transfer Descriptors across multiple USB stream rings. The driver assumed only one TD required clearing per cancellation event, violating the xHCI specification's requirement to reset each stream individually. When freed DMA pages are later accessed by the host controller via stale TD pointers, the result is a classic use-after-free condition in kernel-managed memory.
Attack Vector
Exploitation requires local access and a USB device capable of triggering multi-stream TD cancellation. The reproducer uses hdparm to mark an early disk sector as bad, then reads the device in a loop with cat /dev/sdX > /dev/null. Read errors against UAS devices (such as JMicron controllers) cancel two TDs across different streams. The uncleared TD causes the xHC to fault on unmapped DMA pages within a few iterations. On systems without an IOMMU, the same condition silently corrupts freed memory instead of faulting, creating a path toward memory disclosure or privilege escalation.
No public proof-of-concept exploit is listed for this CVE beyond the reproducer described in the upstream commit message.
Detection Methods for CVE-2024-40927
Indicators of Compromise
- Kernel log entries containing xhci_warn messages related to cancelled TDs or stream handling
- IOMMU fault events referencing xHCI device DMA addresses
- Unexpected xHC host controller resets or USB bus disconnections during I/O errors
- Hangs or stuck USB devices after unmounting or disconnecting UAS storage
Detection Strategies
- Monitor dmesg and systemd journal output for xHCI warnings, DMAR faults, and controller reset events
- Audit kernel versions across Linux fleets and flag hosts running pre-patch builds
- Correlate storage I/O errors on UAS devices with subsequent USB subsystem instability
Monitoring Recommendations
- Centralize kernel ring buffer logs into a SIEM for pattern analysis of xHCI and IOMMU events
- Alert on repeated USB controller resets, which may indicate exploitation attempts or triggered faults
- Track package versions of linux-image across endpoints and servers to confirm patch deployment
How to Mitigate CVE-2024-40927
Immediate Actions Required
- Apply the vendor kernel update containing commits 26460c1, 5ceac44, 61593dc, 633f72c, or 949be4e depending on your stable branch
- Reboot systems after installing the updated kernel to activate the fix
- Prioritize patching endpoints and servers that use USB attached storage, particularly UAS devices
Patch Information
The upstream fix is distributed across several stable branches via Kernel Git Commit 26460c1, Kernel Git Commit 5ceac44, Kernel Git Commit 61593dc, Kernel Git Commit 633f72c, and Kernel Git Commit 949be4e. Debian users should consult the Debian LTS Announcement January 2025 for distribution-specific packages.
Workarounds
- Enable the system IOMMU to convert silent memory corruption into detectable DMA faults until patching is complete
- Avoid connecting UAS storage devices on unpatched systems, or force the usb-storage driver via the usb-storage.quirks kernel parameter to bypass UAS
- Restrict physical USB access on multi-user systems to reduce the attack surface for local exploitation
# Force non-UAS mode for a specific USB device (replace VID:PID)
# Add to kernel command line or /etc/modprobe.d/
usb-storage.quirks=174c:55aa:u
# Verify kernel version after patching
uname -r
# Check for xHCI warnings in kernel log
dmesg | grep -iE 'xhci|dmar|iommu'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

