Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18764524ybl; Fri, 3 Jan 2020 08:36:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyhL2JrV3EGdhw7cGbXktLGWEiZ/ilhufkGFYp16VAaV3xVBXdtYneSh/zkyzEmSLsg2fDI X-Received: by 2002:a05:6830:1653:: with SMTP id h19mr82532060otr.305.1578069384197; Fri, 03 Jan 2020 08:36:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578069384; cv=none; d=google.com; s=arc-20160816; b=EkvTwX2ttjUfRCvoxYvnG3xZLkyjnFGhUaoEBh/RnzZgarU5wjgATK2qNdiLh96zns pLOk79zaJhqCBMBGbH34ao4cjp3XXD7Fsni3JrSlPYo3LZXYgHUyL7RNjYKOcMqWsoJ4 kd3+tidy2ScWF7U/GkLiujkVuqJ8UmlcxqM7an+drhkB3LHdmW+jS6cPzQspwTRDL8aj MCgk9o9wZuIw8kq4a9sNzirunKTZrDz7Z8DIGxpUrfennhA3PVXsvjQvcxEVa191ZEsT PbMC+zQrPZqSI5QysN9PSsIgWimO+IJKzcLqT5h6q64QiCBosQXhv7I+twptpOBvLo+g KJ0g== 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=p1uMLiPq8e7RCDvZXpya6BsikHyWECh9hH2ZwqIXiRQ=; b=sOQvurXBoo1zdQrmWWwGWuRHAwFfvdrd/HxtIegKj8OXwjFv+BZ+/UsQ+ntgkg9l9D 4RwmIrFtpFnd32k/eJY2rqFhefmVIEzs0tLB4cxrtkxxcfhjQtvnR5F+UMeB7I8bBmSg ae8L910RmFCVJcuNu3Qukc9CjT46aX/nJ80zylPiyb/Uf14Ic3Om3Ytt8q3Az2uMbOzH QwUw5X43LxKnD2GfSWqWPeVfLUDiOCkXh/GTAWujEi98US1YcwK7gKdhyM26hpY7AM83 cBulASPdhrcvuwXD1g5ZJcYf1tr45JcQ73Kf2SzzFFle8ds2RdPk8VZX3krQ/iBeTFJw r8Lg== 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 a10si28152254oia.232.2020.01.03.08.36.11; Fri, 03 Jan 2020 08:36:24 -0800 (PST) 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 S1728023AbgACQfX (ORCPT + 99 others); Fri, 3 Jan 2020 11:35:23 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:34910 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727980AbgACQfX (ORCPT ); Fri, 3 Jan 2020 11:35:23 -0500 Received: (qmail 5097 invoked by uid 2102); 3 Jan 2020 11:35:22 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 3 Jan 2020 11:35:22 -0500 Date: Fri, 3 Jan 2020 11:35:22 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: syzbot cc: andreyknvl@google.com, , , , , , Subject: Re: WARNING in usbhid_raw_request/usb_submit_urb (2) In-Reply-To: <00000000000043a9a3059ae3c8ef@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 Sun, 29 Dec 2019, syzbot wrote: > syzbot has found a reproducer for the following crash on: > > HEAD commit: ecdf2214 usb: gadget: add raw-gadget interface > git tree: https://github.com/google/kasan.git usb-fuzzer > console output: https://syzkaller.appspot.com/x/log.txt?x=17416885e00000 > kernel config: https://syzkaller.appspot.com/x/.config?x=b06a019075333661 > dashboard link: https://syzkaller.appspot.com/bug?extid=10e5f68920f13587ab12 > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13598885e00000 > > IMPORTANT: if you fix the bug, please add the following tag to the commit: > Reported-by: syzbot+10e5f68920f13587ab12@syzkaller.appspotmail.com > > ------------[ cut here ]------------ > usb 1-1: BOGUS urb xfer, pipe 2 != type 2 > WARNING: CPU: 0 PID: 2388 at drivers/usb/core/urb.c:478 > usb_submit_urb+0x1188/0x13b0 drivers/usb/core/urb.c:478 That's a strange diagnostic. Let's see what's really going on. Alan Stern #syz test: https://github.com/google/kasan.git ecdf2214 Index: usb-devel/drivers/usb/core/urb.c =================================================================== --- usb-devel.orig/drivers/usb/core/urb.c +++ usb-devel/drivers/usb/core/urb.c @@ -204,10 +204,14 @@ int usb_urb_ep_type_check(const struct u const struct usb_host_endpoint *ep; ep = usb_pipe_endpoint(urb->dev, urb->pipe); - if (!ep) + if (!ep) { + dev_info(&urb->dev->dev, "Pipe 0x%x, no ep\n", urb->pipe); return -EINVAL; - if (usb_pipetype(urb->pipe) != pipetypes[usb_endpoint_type(&ep->desc)]) + } + if (usb_pipetype(urb->pipe) != pipetypes[usb_endpoint_type(&ep->desc)]) { + dev_info(&urb->dev->dev, "Pipe/ep type mismatch\n"); return -EINVAL; + } return 0; } EXPORT_SYMBOL_GPL(usb_urb_ep_type_check);