提交 0ac913ef 编写于 作者: S Shuah Khan 提交者: Zheng Zengkai

usbip: vhci_hcd fix shift out-of-bounds in vhci_hub_control()

commit 1cc5ed25 upstream.

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: syzbot+3dea30b047f41084de66@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210324230654.34798-1-skhan@linuxfoundation.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 d5006b85
...@@ -594,6 +594,8 @@ static int vhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, ...@@ -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); pr_err("invalid port number %d\n", wIndex);
goto error; goto error;
} }
if (wValue >= 32)
goto error;
if (hcd->speed == HCD_USB3) { if (hcd->speed == HCD_USB3) {
if ((vhci_hcd->port_status[rhport] & if ((vhci_hcd->port_status[rhport] &
USB_SS_PORT_STAT_POWER) != 0) { USB_SS_PORT_STAT_POWER) != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册