Skip to content

Commit

Permalink
usbip: vhci_hcd fix shift out-of-bounds in vhci_hub_control()
Browse files Browse the repository at this point in the history
Fix shift out-of-bounds in vhci_hub_control() SetPortFeature handling.

UBSAN: shift-out-of-bounds in drivers/usb/usbip/vhci_hcd.c:605:42
shift exponent 768 is too large for 32-bit type 'int'

Reported-by: [email protected]
Cc: [email protected]
Signed-off-by: Shuah Khan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
shuahkh authored and gregkh committed Mar 26, 2021
1 parent 0bd8604 commit 1cc5ed2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/usbip/vhci_hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
pr_err("invalid port number %d\n", wIndex);
goto error;
}
if (wValue >= 32)
goto error;
if (hcd->speed == HCD_USB3) {
if ((vhci_hcd->port_status[rhport] &
USB_SS_PORT_STAT_POWER) != 0) {
Expand Down

0 comments on commit 1cc5ed2

Please sign in to comment.