CVE-2024-40927
xhci: Handle TD clearing for multiple streams case
Mitigation
- Upgrade Linux to 5ceac4402f5d975e5a01c806438eb4e554771577 or later.
Who should check
- Anyone running Linux >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 26460c1afa311524f588e288a4941432f0de6228; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 633f72cb6124ecda97b641fbc119340bd88d51a9; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 949be4ec5835e0ccb3e2a8ab0e46179cb5512518; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 61593dc413c3655e4328a351555235bc3089486a; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 5ceac4402f5d975e5a01c806438eb4e554771577
- Anyone running Linux 2.6.35
Vulnerability facts
- Affected
- Linux >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 26460c1afa311524f588e288a4941432f0de6228; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 633f72cb6124ecda97b641fbc119340bd88d51a9; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 949be4ec5835e0ccb3e2a8ab0e46179cb5512518; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 61593dc413c3655e4328a351555235bc3089486a; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 5ceac4402f5d975e5a01c806438eb4e554771577; Linux 2.6.35
- Fixed in
- Linux 26460c1afa311524f588e288a4941432f0de6228, Linux 633f72cb6124ecda97b641fbc119340bd88d51a9, Linux 949be4ec5835e0ccb3e2a8ab0e46179cb5512518, Linux 61593dc413c3655e4328a351555235bc3089486a, Linux 5ceac4402f5d975e5a01c806438eb4e554771577
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.8 (v3.1, NVD)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.33% chance of exploitation in 30 days (percentile 18, 2026-11-26)
- CWE
- CWE-416
- Modified
Description
In the Linux kernel, the following vulnerability has been resolved: xhci: Handle TD clearing for multiple streams case When multiple streams are in use, multiple TDs might be in flight when an endpoint is stopped. We need to issue a Set TR Dequeue Pointer for each, to ensure everything is reset properly and the caches cleared. Change the logic so that any N>1 TDs found active for different streams are deferred until after the first one is processed, calling xhci_invalidate_cancelled_tds() again from xhci_handle_cmd_set_deq() to queue another command until we are done with all of them. Also change the error/"should never happen" paths to ensure we at least clear any affected TDs, even if we can't issue a command to clear the hardware cache, and complain loudly with an xhci_warn() if this ever happens. This problem case dates back to commit e9df17eb1408 ("USB: xhci: Correct assumptions about number of rings per endpoint.") early on in the XHCI driver's life, when stream support was first added. It was then identified but not fixed nor made into a warning in commit 674f8438c121 ("xhci: split handling halted endpoints into two steps"), which added a FIXME comment for the problem case (without materially changing the behavior as far as I can tell, though the new logic made the problem more obvious). Then later, in commit 94f339147fc3 ("xhci: Fix failure to give back some cached cancelled URBs."), it was acknowledged again. [Mathias: commit 94f339147fc3 ("xhci: Fix failure to give back some cached cancelled URBs.") was a targeted regression fix to the previously mentioned patch. Users reported issues with usb stuck after unmounting/disconnecting UAS devices. This rolled back the TD clearing of multiple streams to its original state.] Apparently the commit author was aware of the problem (yet still chose to submit it): It was still mentioned as a FIXME, an xhci_dbg() was added to log the problem condition, and the remaining issue was mentioned in the commit description. The choice of making the log type xhci_dbg() for what is, at this point, a completely unhandled and known broken condition is puzzling and unfortunate, as it guarantees that no actual users would see the log in production, thereby making it nigh undebuggable (indeed, even if you turn on DEBUG, the message doesn't really hint at there being a problem at all). It took me *months* of random xHC crashes to finally find a reliable repro and be able to do a deep dive debug session, which could all have been avoided had this unhandled, broken condition been actually reported with a warning, as it should have been as a bug intentionally left in unfixed (never mind that it shouldn't have been left in at all). > Another fix to solve clearing the caches of all stream rings with > cancelled TDs is needed, but not as urgent. 3 years after that statement and 14 years after the original bug was introduced, I think it's finally time to fix it. And maybe next time let's not leave bugs unfixed (that are actually worse than the original bug), and let's actually get people to review kernel commits please. Fixes xHC crashes and IOMMU faults with UAS devices when handling errors/faults. Easiest repro is to use `hdparm` to mark an early sector (e.g. 1024) on a disk as bad, then `cat /dev/sdX > /dev/null` in a loop. At least in the case of JMicron controllers, the read errors end up having to cancel two TDs (for two queued requests to different streams) and the one that didn't get cleared properly ends up faulting the xHC entirely when it tries to access DMA pages that have since been unmapped, referred to by the stale TDs. This normally happens quickly (after two or three loops). After this fix, I left the `cat` in a loop running overnight and experienced no xHC failures, with all read errors recovered properly. Repro'd and tested on an Apple M1 Mac Mini (dwc3 host). On systems without an IOMMU, this bug would instead silently corrupt freed memory, making this a ---truncated---
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 26460c1afa311524f588e288a4941432f0de6228; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 633f72cb6124ecda97b641fbc119340bd88d51a9; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 949be4ec5835e0ccb3e2a8ab0e46179cb5512518; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 61593dc413c3655e4328a351555235bc3089486a; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 5ceac4402f5d975e5a01c806438eb4e554771577 | — | cvelist |
| Linux | 2.6.35 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-40927. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-40927.md Affected: Linux >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 26460c1afa311524f588e288a4941432f0de6228; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 633f72cb6124ecda97b641fbc119340bd88d51a9; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 949be4ec5835e0ccb3e2a8ab0e46179cb5512518; >= e9df17eb1408cfafa3d1844… Fixed in: Linux 26460c1afa311524f588e288a4941432f0de6228, Linux 633f72cb6124ecda97b641fbc119340bd88d51a9, Linux 949be4ec5835e0ccb3e2a8ab0e46179cb5512518, Linux 61593dc413c3655e4328a351555235bc3089486a, Linux 5ceac4402f5d975e5a01c806438eb4e554771577 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Patches
- https://git.kernel.org/stable/c/26460c1afa311524f588e288a4941432f0de6228
- https://git.kernel.org/stable/c/633f72cb6124ecda97b641fbc119340bd88d51a9
- https://git.kernel.org/stable/c/949be4ec5835e0ccb3e2a8ab0e46179cb5512518
- https://git.kernel.org/stable/c/61593dc413c3655e4328a351555235bc3089486a
- https://git.kernel.org/stable/c/5ceac4402f5d975e5a01c806438eb4e554771577
FAQ
Is CVE-2024-40927 being exploited?
There is no confirmed exploitation: CVE-2024-40927 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.33% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-40927?
High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2024-40927?
Linux >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 26460c1afa311524f588e288a4941432f0de6228; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 633f72cb6124ecda97b641fbc119340bd88d51a9; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 949be4ec5835e0ccb3e2a8ab0e46179cb5512518; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 61593dc413c3655e4328a351555235bc3089486a; >= e9df17eb1408cfafa3d1844bfc7f22c7237b31b8, < 5ceac4402f5d975e5a01c806438eb4e554771577; Linux 2.6.35.
Is there a fix for CVE-2024-40927?
Yes. Fixed in Linux 26460c1afa311524f588e288a4941432f0de6228, Linux 633f72cb6124ecda97b641fbc119340bd88d51a9, Linux 949be4ec5835e0ccb3e2a8ab0e46179cb5512518, Linux 61593dc413c3655e4328a351555235bc3089486a, Linux 5ceac4402f5d975e5a01c806438eb4e554771577. Upgrade Linux to 5ceac4402f5d975e5a01c806438eb4e554771577 or later.
How do I check if I'm affected by CVE-2024-40927?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.