Skip to content

Commit 18fe2fb

Browse files
committed
usb: xhci: prevent potential failure in handle_tx_event() for Transfer events without TRB
jira LE-2157 cve CVE-2024-42226 Rebuild_History Non-Buildable kernel-5.14.0-503.14.1.el9_5 commit-author Niklas Neronin <[email protected]> commit 66cb618 Some transfer events don't always point to a TRB, and consequently don't have a endpoint ring. In these cases, function handle_tx_event() should not proceed, because if 'ep->skip' is set, the pointer to the endpoint ring is used. To prevent a potential failure and make the code logical, return after checking the completion code for a Transfer event without TRBs. Signed-off-by: Niklas Neronin <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 66cb618) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 2aee3af commit 18fe2fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2660,16 +2660,17 @@ static int handle_tx_event(struct xhci_hcd *xhci,
26602660
else
26612661
xhci_handle_halted_endpoint(xhci, ep, NULL,
26622662
EP_SOFT_RESET);
2663-
goto cleanup;
2663+
break;
26642664
case COMP_RING_UNDERRUN:
26652665
case COMP_RING_OVERRUN:
26662666
case COMP_STOPPED_LENGTH_INVALID:
2667-
goto cleanup;
2667+
break;
26682668
default:
26692669
xhci_err(xhci, "ERROR Transfer event for unknown stream ring slot %u ep %u\n",
26702670
slot_id, ep_index);
26712671
goto err_out;
26722672
}
2673+
return 0;
26732674
}
26742675

26752676
/* Count current td numbers if ep->skip is set */

0 commit comments

Comments
 (0)