CVE-2024-57981: usb: xhci: Fix NULL pointer dereference on certain command aborts
In the Linux kernel, the following vulnerability has been resolved:
usb: xhci: Fix NULL pointer dereference on certain command aborts
If a command is queued to the final usable TRB of a ring segment, the enqueue pointer is advanced to the subsequent link TRB and no further. If the command is later aborted, when the abort completion is handled the dequeue pointer is advanced to the first TRB of the next segment.
If no further commands are queued, xhcihandlestoppedcmdring() sees the ring pointers unequal and assumes that there is a pending command, so it calls xhcimodcmdtimer() which crashes if curcmd was NULL.
Don't attempt timer setup if curcmd is NULL. The subsequent doorbell ring likely is unnecessary too, but it's harmless. Leave it alone.
This is probably Bug 219532, but no confirmation has been received.
The issue has been independently reproduced and confirmed fixed using a USB MCU programmed to NAK the Status stage of SETADDRESS forever. Everything continued working normally after several prevented crashes.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2024-57981?
CVE-2024-57981 has been categorized as a moderate severity vulnerability due to its potential impact on system stability.
How do I fix CVE-2024-57981?
To fix CVE-2024-57981, you should update the Linux kernel to a version that has resolved this vulnerability.
What systems are affected by CVE-2024-57981?
CVE-2024-57981 affects various versions of the Linux kernel, particularly those between versions 3.16 and 6.1.129, as well as newer versions.
What type of vulnerability is CVE-2024-57981?
CVE-2024-57981 is a NULL pointer dereference vulnerability that occurs during certain command aborts in the USB xHCI subsystem.
Can CVE-2024-57981 be exploited remotely?
Exploitation of CVE-2024-57981 typically requires local access to the system, making remote exploitation unlikely.