Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1473755pxb; Tue, 26 Oct 2021 09:37:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwByQF0tsIQ9iPqpJ06NVzBFmyus5f2baETYEhA4dsl2UD7azc4rpqtpE1nWiDXLBp28gTn X-Received: by 2002:a17:906:ce38:: with SMTP id sd24mr32174859ejb.316.1635266268586; Tue, 26 Oct 2021 09:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635266268; cv=none; d=google.com; s=arc-20160816; b=PyuqbRqfLFDzVmZRmQFNpBvsUg3IHHYD0VrHdc3Vo13lBLj6ugzBl5qvVAXzmI07jH Rn4RdEIGhYmUEWl37HFQD476CzZAdPuxrvHClZj0DXiweKbUsW7tm7CjvDwrtziSCw/a Q4aYcTtJPE0gxNaYoVcglsh29S3AU0Rx3D9bo1lV0FYzVC9QiVG1El4CsxrzXcAsaTxk VQwt6dC244iOdE22xPJYA1uhxV73hyD/JQDLvaE8cscTcHcyjy68NzCcN2PIJ7C+6Txy Wk+KO8xyWjPCBAo5QimiKRd1kUiRk+Dw+nIjGgtfRuVhEfvjnws1kNIGlufMYX7JZBey GmEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AvpeDdzSgg2cU/dLF437rkm4BRfpE/E5T2T8vJEhwiU=; b=pfCaDWYKYVfLFJ27L8Syc4KB15xyhAjLeM9t3P1QlVbIoUbLIBk+/93T4WsFgh2qWi ymjNp0sF+qPM9qZUob4VNHTkUmbv63iL/cnFA35fjDhYXTaSz9URw5tJUBWzDCD4KWh1 TFNHNcd5vx2PBjflN4Hzs4fV5HeVPxiRNQd228p5zszpeSAVNuCyM13WEGHdQLBFaVis YiQrcooHLsMbFeSMASwKtxj3iy0txltwoNF5j6bZvHsXNTjXG+V0GICmFPNy5BJkdTsZ j62FijjY8G9SJA5ePe8tumDUry/SWh1A6VyCYU2ZzG5X7zQGSPk+XnOjbkgqGPiMtn18 Zc5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UIuWKZ5B; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si14536362edj.242.2021.10.26.09.37.23; Tue, 26 Oct 2021 09:37:48 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=UIuWKZ5B; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235740AbhJZMgh (ORCPT + 99 others); Tue, 26 Oct 2021 08:36:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:46756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbhJZMgh (ORCPT ); Tue, 26 Oct 2021 08:36:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6D19460EBD; Tue, 26 Oct 2021 12:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635251653; bh=OgXTpTqGy+Puhv4DfZesA7ODv5bRJ4Hhhmq8mNydSYg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UIuWKZ5B4Yqs5ADcEeVsg2EKfFDwtukCsjYhTxnxGoDOR+kfBHhpZbxOqnwxFqm/3 EcXK/xMg19Pgy0gp8hU1cC0U+szZgAt4w3OZVajA2+hLSI6uvw1DuCK0xnVSqSZMsA QJ8AVXz5y/PIBhKFQjF6gyF/jjkII2IahuVzngghZTy8TcuheJivukuXIfB4VPUnYd ztz0eJ4PMVlSu6KOGbFhdmYKOUpONik7cI1TIRDSXb4H3QiwFW50YqHmYEpTE+b5Ph D/GO1Y6G2DCI5JoJYuiAKH09ReLKSMV7gfEcLizcdz6Ozy7rzL5cNFPpxfnHS4Kmhr 0tVEVQIbNB9nQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1mfLeP-0001j9-Bo; Tue, 26 Oct 2021 14:33:57 +0200 Date: Tue, 26 Oct 2021 14:33:57 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Oliver Neukum , syzbot+76bb1d34ffa0adc03baa@syzkaller.appspotmail.com, Jakub Kicinski Subject: Re: [PATCH 5.14 165/169] usbnet: sanity check for maxpacket Message-ID: References: <20211025191017.756020307@linuxfoundation.org> <20211025191038.360463849@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211025191038.360463849@linuxfoundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 09:15:46PM +0200, Greg Kroah-Hartman wrote: > From: Oliver Neukum > > commit 397430b50a363d8b7bdda00522123f82df6adc5e upstream. > > maxpacket of 0 makes no sense and oopses as we need to divide > by it. Give up. > > V2: fixed typo in log and stylistic issues > > Signed-off-by: Oliver Neukum > Reported-by: syzbot+76bb1d34ffa0adc03baa@syzkaller.appspotmail.com > Reviewed-by: Johan Hovold > Link: https://lore.kernel.org/r/20211021122944.21816-1-oneukum@suse.com > Signed-off-by: Jakub Kicinski > Signed-off-by: Greg Kroah-Hartman Please drop this one from all stable queues until https://lore.kernel.org/r/20211026124015.3025136-1-wanghai38@huawei.com has landed. > --- > drivers/net/usb/usbnet.c | 4 ++++ > 1 file changed, 4 insertions(+) > > --- a/drivers/net/usb/usbnet.c > +++ b/drivers/net/usb/usbnet.c > @@ -1788,6 +1788,10 @@ usbnet_probe (struct usb_interface *udev > if (!dev->rx_urb_size) > dev->rx_urb_size = dev->hard_mtu; > dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1); > + if (dev->maxpacket == 0) { > + /* that is a broken device */ > + goto out4; > + } > > /* let userspace know we have a random address */ > if (ether_addr_equal(net->dev_addr, node_id)) Johan