Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2260704pxb; Mon, 11 Jan 2021 05:26:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAVAPKCbp2W3e0MRsHtKkoW2/lLqicqKdGZKNRwMAZBWxALQyBrOsnzXqL3Azc9OflbO8O X-Received: by 2002:a05:6402:487:: with SMTP id k7mr14210514edv.130.1610371581503; Mon, 11 Jan 2021 05:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610371581; cv=none; d=google.com; s=arc-20160816; b=Feuiki2IX0qIoMGaqlyyGcDpoFUMfWk2WdAkh6XT4ovh6ZFFIis/3+zmfGJs9KCXU3 ixj8sSHeG40utWWizsMHkl2Hl1LKHIGEh0efFMpZjIehzaUlNvsvtDAj/hIAT01p9Rmw p3Xc0F5COyO2ke7F8dCfpZnP/oYhpxvQM/tNrmevUWUDvYT56ZegpGj5/0KD+HyOaePi J1Oz8qkDSzaD06febO3PZ6frFAlS0IAkHlTjJGhKCA75PN2T4JwslAK7FQDcQDJsmdhB jZJIw0g6eGhiaezSWGLdCjD0n/VaEGNKxI2ryYhV9zhUdi0A9MpRqAhOc5mXlDEp180V QdDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uXc3HDBh2PtvZwE4y7JUERtTpn0CW6WLpAzMXexEr1o=; b=K7h3nQwThMmDlKZg/fcLb8UxOV0xzI5MprHmapeycL7y5XjrJCt1fULoF1Z8mOr2ju u5ByLB1y4rHl6OehjdYu4RyjuldOFLhEwsvzJ4WkYwCucUdfeQyNbfTlJMT2xYtbmEsy G5Dmy3sKCg3Lkq1EYo8l3CKZxXwRYPX5hOkcslegZJMdFTX4HgHSewd4OaIofy0mEjvU lC4uYjZsfZpcn01quseJ7nISSe4ZnRw8bMXzEI0hc9Moc7MZcy9J0ikte9ww96s53dvX gyETxBciD/LczeK3E4jXdZlfGoIqF7LAQhsNKx7XPhF5i/axq1GRhNr4yJ5qnlkm6PwW /+Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ogF+5Ed/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b22si6634051ejk.400.2021.01.11.05.25.56; Mon, 11 Jan 2021 05:26:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ogF+5Ed/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732092AbhAKNOU (ORCPT + 99 others); Mon, 11 Jan 2021 08:14:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:60788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732013AbhAKNN4 (ORCPT ); Mon, 11 Jan 2021 08:13:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E356622AAB; Mon, 11 Jan 2021 13:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370795; bh=/pd8RLnDeNu7p+BdZvik1txSdKxNe8f/cfwwP4ayZU8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ogF+5Ed/ekbGB73CJG0fdit2WXTS4QnaYYosoPrxCcU0CQgHVvCfU/yRzNF3pW/wL ArNC7Ph7ejbrJMrKk5Qz4SY8ODEAAN1t1o4NCmbDLg9IBX8fy+Tkw3CCE9gT1G+M9n Cz9llMgmfK95cQlmKeCdaQ9OOxha+ga4m3zBlGEo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Randy Dunlap , syzbot+297d20e437b79283bf6d@syzkaller.appspotmail.com, Yuyang Du , Shuah Khan , linux-usb@vger.kernel.org Subject: [PATCH 5.4 59/92] usb: usbip: vhci_hcd: protect shift size Date: Mon, 11 Jan 2021 14:02:03 +0100 Message-Id: <20210111130041.991864965@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Randy Dunlap commit 718bf42b119de652ebcc93655a1f33a9c0d04b3c upstream. 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") Signed-off-by: Randy Dunlap Reported-by: syzbot+297d20e437b79283bf6d@syzkaller.appspotmail.com Cc: Yuyang Du Cc: Shuah Khan Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: stable Link: https://lore.kernel.org/r/20201229071309.18418-1-rdunlap@infradead.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/usbip/vhci_hcd.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -396,6 +396,8 @@ static int vhci_hub_control(struct usb_h default: usbip_dbg_vhci_rh(" ClearPortFeature: default %x\n", wValue); + if (wValue >= 32) + goto error; vhci_hcd->port_status[rhport] &= ~(1 << wValue); break; }