Skip to contentSkip to conversation

patch "usb: usbip: vhci_hcd: protect shift size" added to usb-linus

PATCH [email protected] 1 participant 1 message Jan 4, 2021

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: usbip: vhci_hcd: protect shift size

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 718bf42b119de652ebcc93655a1f33a9c0d04b3c Mon Sep 17 00:00:00 2001
From: Randy Dunlap <[email protected]>
Date: Mon, 28 Dec 2020 23:13:09 -0800
Subject: usb: usbip: vhci_hcd: protect shift size

Fix shift out-of-bounds in vhci_hcd.c:

  UBSAN: shift-out-of-bounds in ../drivers/usb/usbip/vhci_hcd.c:399:41
  shift exponent 768 is too large for 32-bit type 'int'
Fixes 03cd00d538a6 ("usbip: vhci-hcd: Set the vhci structure up to work")
Reported-by [email protected]
Cc Yuyang Du <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc stable <[email protected]>
---
 drivers/usb/usbip/vhci_hcd.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/usbip/vhci_hcd.c +2 -0
index 66cde5e5f796..3209b5ddd30c 100644
@@ -396,6 +396,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
 		default:
 			usbip_dbg_vhci_rh(" ClearPortFeature: default %x\n",
 					  wValue);
+			if (wValue >= 32)
+				goto error;
 			vhci_hcd->port_status[rhport] &= ~(1 << wValue);
 			break;
 		}
Signature · 1 line
2.30.0