Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3570927yba; Tue, 16 Apr 2019 14:16:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQXB8JRDBZFyUHtDCmpjpITDQz1GGC3GYSerFPq5EITiwJVT4ckJUdh9gl8VEi/CWJjbfx X-Received: by 2002:a65:4183:: with SMTP id a3mr80880884pgq.121.1555449414418; Tue, 16 Apr 2019 14:16:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555449414; cv=none; d=google.com; s=arc-20160816; b=F0Nq6no+SIS+seVo67uRyQkjZQDh/0AEFfOCB1nsPPcw2r1fvU1XSVo7AuVllLDzrV AIh0JjW4ipjRdzQt8T7WBJNkTZTqZxieWqKhvehUcGHk0JOdfmsN6ugIstDfnZVuedAM iub+w30K9wMbyKesYdsjpWj2U3GU2gBK1sJ53xrv7KwiZ5/46xtdNbRg0gyqG/H+MXbt 7xxJnarlixm2pzfxgHIVW7kp0ro5c30A/K5Zj0twq3ACUa69yN7BNAWpRyN0YgARly1s QBh1STqFKS7FY6wnYZkOxNdN4NIbZ6bGrKBrvMfH2376hrRowAVroQgla+FLkXHtpM4s 0b2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=ao08LrWVcW+k3UyTSjqPVcbSWcz1Jlp8CV+kr7rpbJY=; b=zaKTWc9gCRW13W57AnG+U5Z8MCbIQ03/eiCnjzoEJR4zE5IHmKJ6vZP0zScoiz+hQE LnWX2zFDVDrnh2W17ICN4XUi2TYsn0GFPLeH4i/ynrBTc+VgIXJpNiVgJRvKwhDi1C5r SjTd3+DNal7WsltOLTqwFjI5Mju6R86LBCXTnG3LSN0peMD1lYzmVO4cjEq55B9hWfE0 9IK5vVKANzwvRltVXZ6azZYuzdZXYLka1DLhnIJoy1sQ1N6rHNSltdA6CP1W8uLw3dbh fp4pgz2S9CDEqkhDJwpYpnAghVNlEYrftFhHs8lXAq9BTGGqpS32QalkH3BOX53ZCg0T SlGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1si32897620plo.212.2019.04.16.14.16.38; Tue, 16 Apr 2019 14:16:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729137AbfDPVOj (ORCPT + 99 others); Tue, 16 Apr 2019 17:14:39 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:43688 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728052AbfDPVOj (ORCPT ); Tue, 16 Apr 2019 17:14:39 -0400 Received: (qmail 14034 invoked by uid 2102); 16 Apr 2019 17:14:38 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 16 Apr 2019 17:14:38 -0400 Date: Tue, 16 Apr 2019 17:14:38 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: syzbot cc: andreyknvl@google.com, , , , , Subject: Re: INFO: task hung in usb_kill_urb In-Reply-To: <000000000000fb61d40586aa6a1e@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Apr 2019, syzbot wrote: > Hello, > > syzbot has tested the proposed patch and the reproducer did not trigger > crash: Slight fixup to the patch. Unsupported speeds aren't necessarily bogus, and what matters is the actual speed rather than the max_speed. Also, we want to be able to give back unlinked URBs even after a frame's total bandwidth has been exhausted. Alan Stern #syz test: https://github.com/google/kasan.git usb-fuzzer --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -979,8 +979,18 @@ static int dummy_udc_start(struct usb_ga struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g); struct dummy *dum = dum_hcd->dum; - if (driver->max_speed == USB_SPEED_UNKNOWN) + switch (g->speed) { + /* All the speeds we support */ + case USB_SPEED_LOW: + case USB_SPEED_FULL: + case USB_SPEED_HIGH: + case USB_SPEED_SUPER: + break; + default: + dev_err(dummy_dev(dum_hcd), "Unsupported driver max speed %d\n", + driver->max_speed); return -EINVAL; + } /* * SLAVE side init ... the layer above hardware, which @@ -1784,7 +1794,7 @@ static void dummy_timer(struct timer_lis /* Bus speed is 500000 bytes/ms, so use a little less */ total = 490000; break; - default: + default: /* Can't happen */ dev_err(dummy_dev(dum_hcd), "bogus device speed\n"); return; } @@ -1828,7 +1838,7 @@ restart: /* Used up this frame's bandwidth? */ if (total <= 0) - break; + continue; /* find the gadget's ep for this request (if configured) */ address = usb_pipeendpoint (urb->pipe);