Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3718450yba; Tue, 23 Apr 2019 08:30:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqza4PH9BxgoVFvWP+T35jByQFMTZ2wgDe1XhggQzT3QVXGh5UdMv82GtUQTFjHB+edQWyJS X-Received: by 2002:a65:6688:: with SMTP id b8mr3315051pgw.81.1556033421459; Tue, 23 Apr 2019 08:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556033421; cv=none; d=google.com; s=arc-20160816; b=AmFflmetZJp5Dxf3mX3FC1rAIELsYKUsyY6onlEuPcZVi3rOHRkbcfHaWiPeXsgMTt S5TvcZcS2ulqnc92Tl9rSbJ9Y9Z/4yoSi1ucg0XeONHyem7zLnvYNYY++pvgHS+eHYjj R+ZSiVql9xVS5tFz6/mvcZxagKjphujM2giI0pcFZJBv+u5PSi8VSbyE0Ql92m4pvkfT 8wsGYVR7RGcOc/Wix0DvU0BVWqcMvlvGS5QIjTu0+L3CTHDdZzyxZaBH55bRioB29Jt5 Lm+vIxtHfaV5QSraIq+ubhnVY3zmh2ytn1g05WzI5s85EiVnUzfAsk0W1zQHF+HMG/of FXfg== 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=Kn1cmAOSQevn67WhrQ5+lckiyFAPTubISUtj3i8d5XI=; b=My3Snxq2auMdqzjNDIoScaWduWpMBJOWt4jhdqMjoiRuZuKvzo8M0erD5YHzH2abqJ IHQV24/0edeaevlCd8Bzd9r8LPk2PPvr7NDSclUih27gYTZxQi9TS7hBV8KhTaZVYd/g RlX81UUgAUzPDcszVhF/C97sC+N9deCsU2SNev1MFD8LZ/gw2cQkK2g9vY6L1z6SZHU0 seU/0XQFANJWWYd+teZAatRUjmG/FkqlCXvgWMc0ZxYw/ytp+iXm7KGXUg96RbKefdxB PGARG9e21uAO6Y/l6wFdUBfPrUq1I+J6wwgsUJKbmbzJVjdhTuUEl5ZvOMByckBahvwk KbAw== 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 k66si14987840pgc.247.2019.04.23.08.30.05; Tue, 23 Apr 2019 08:30:21 -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 S1728362AbfDWP2w (ORCPT + 99 others); Tue, 23 Apr 2019 11:28:52 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:58256 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727305AbfDWP2w (ORCPT ); Tue, 23 Apr 2019 11:28:52 -0400 Received: (qmail 5111 invoked by uid 2102); 23 Apr 2019 11:28:50 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 Apr 2019 11:28:50 -0400 Date: Tue, 23 Apr 2019 11:28:50 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Andrey Konovalov cc: syzbot , Greg Kroah-Hartman , Kernel development list , USB list , , syzkaller-bugs , Dmitry Vyukov Subject: Re: general protection fault in __dev_printk In-Reply-To: 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, 23 Apr 2019, Andrey Konovalov wrote: > > This original bug report included a "USB disconnect" line, as shown > > above. The newer results, for runs with my patches added, do not. At > > least, if such a line was present, it didn't show up in the console > > output files -- the most recent one contains nothing but repeats of > > that "yurex_interrupt - unknown status received: -71" line, although > > for devices on multiple buses. > > > > Is there any way to get more information about what's happening, such > > as a complete kernel log? > > It should be possible to provide the full log for the result of the > "syz test" command. I'll talk to Dmitry about this when he's back from > vacation next week. > > > And perhaps to run the test with just a > > single dummy-hcd bus instead of 6? > > Hm, it might be possible to implement overriding of syz-execprog flags > and provide them via "syz test". It's not implemented right now > though. > > Running the reproducer manually is the most flexible way to make > changes to the way it's ran or to make changes to the environment. In > this case I haven't managed to reproduce the hang manually though :( > > I see two ways to deal with this right now: > > 1. Submit your fix (it fixes the original issue for me) and wait until > it gets into the usb-fuzzer tree. Then maybe syzbot will report the > hang and provide a better reproducer. > > 2. Change the testing patch to also suppress those "yurex_interrupt - > unknown status received: -71" messages and rerun the "syz test" > command. Hopefully then syzbot will provide the full kernel log. That's a great suggestion! Here's the next attempt. Alan Stern #syz test: https://github.com/google/kasan.git usb-fuzzer --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c @@ -143,8 +143,10 @@ static void yurex_interrupt(struct urb * /* The device is terminated, clean up */ return; default: +#if 0 dev_err(&dev->interface->dev, "%s - unknown status received: %d\n", __func__, status); +#endif goto exit; } @@ -178,6 +180,10 @@ static void yurex_interrupt(struct urb * } exit: + if (!usb_get_intfdata(dev->interface)) { + dev_info(&dev->interface->dev, "%s unbound\n", __func__); + return; + } retval = usb_submit_urb(dev->urb, GFP_ATOMIC); if (retval) { dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n", @@ -309,11 +315,15 @@ static void yurex_disconnect(struct usb_ dev = usb_get_intfdata(interface); usb_set_intfdata(interface, NULL); + dev_info(&interface->dev, "%s\n", __func__); /* give back our minor */ usb_deregister_dev(interface, &yurex_class); /* prevent more I/O from starting */ + dev_info(&interface->dev, "Before poison\n"); + usb_poison_urb(dev->urb); + dev_info(&interface->dev, "After poison\n"); mutex_lock(&dev->io_mutex); dev->interface = NULL; mutex_unlock(&dev->io_mutex);