Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4169880ybv; Mon, 10 Feb 2020 13:50:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyuObiuplfl1Ao+YhLCt6amNCZNdqX0FBGfiAcD95efeQqyxW+MV3gx/mYTIwVi5qU9JOfU X-Received: by 2002:aca:c08b:: with SMTP id q133mr788523oif.46.1581371432702; Mon, 10 Feb 2020 13:50:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581371432; cv=none; d=google.com; s=arc-20160816; b=isQGAxCc0Onz5qstswBjIF4Bd7p9ia0DEhLKnLMFBwoEpVhw1atkEPyvOl5MdFYFLE ZkMnc5G+RQ1gS7iF+OszrIQi6H/YnSYlVK3rcflS5DcbjtD/iTdtk014VPteNeI2PuaF heRC5YqtN+9LHWp/0cI6sxCqPOaDmzzi7YkUcsCVQIVyG2/5Oki487EyhqMguN+nPsCw m4pLN4rxGwQe+5Q+oZk3yYjyk2vV0ys5snCvUr/gLFCMG8mWqvz0aIjEvFF2Boq/bmkU Ifzd+MN4Lr7RProKer8A/ZhjUO8wYn6XJuJANvVMriQCFqalerbgNSGzyE+Ynr3DsnuD F40Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=nOjy3urDqE0NAYvSVP4+y5QlIyXQPcdb5T6/8q+xFvE=; b=s5vPuScoQWi/j4eHtmUDn59v8z4ss+JTK99XVBpu1ZHLZWG7NLn5j9pMptEa9fO5tM lti8MojOjv5Gkej0YgFI50zH0ETHD/Wwh8RuR71eH/8HLQrysKnO/zwavO92jnvmPPyM tRit7FXcrYVaOwVtyaqnLVoQ1eCFmjy4JLsADALwlrDSoZGpMep9mx/G74GML7hMVVEL Chnzjb1vPGoSBKJdQL5iFmqcFHM+hVl1YFfKiUrQLpUXMVh2OeYwIv7BPVMNBRDkk94s dYu6s5zWo7uik0n5Y61XX+KQeTDom4q7oT346MjS6lG5/Hv8+izxlAfocfo3tKtM+E9z Zfkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B7Wac62S; 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 m17si893992otk.109.2020.02.10.13.50.20; Mon, 10 Feb 2020 13:50:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=B7Wac62S; 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 S1727431AbgBJVuI (ORCPT + 99 others); Mon, 10 Feb 2020 16:50:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:46216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727003AbgBJVuH (ORCPT ); Mon, 10 Feb 2020 16:50:07 -0500 Received: from localhost (unknown [104.132.1.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6056020733; Mon, 10 Feb 2020 21:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581371407; bh=owHQZja7WYcROTLPbbAABiKavRBsJY96RmXIGENBBaM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B7Wac62SNF21DMh+x9ak6ktlFN0yWHiJbqfEd4lRpQgU7LZltpBDjLigWkJLrOfba NII3D0tMB61y5IN8DmC2otgWr2kRwfm7SR8CJhHq1MUiNWy9qTIRtSRANsLVWGuwgC c2RMttje9d/oaf94qCQAbhcXJNFODd9KUXbMlbw8= Date: Mon, 10 Feb 2020 13:50:06 -0800 From: Greg KH To: Alan Stern Cc: Dan Carpenter , syzbot , andreyknvl@google.com, ingrassia@epigenesys.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [PATCH] usb: core: urb: change a dev_WARN() to dev_err() for syzbot Message-ID: <20200210215006.GA1628323@kroah.com> References: <20200210190419.GC1058087@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 10, 2020 at 04:11:10PM -0500, Alan Stern wrote: > On Mon, 10 Feb 2020, Greg KH wrote: > > > On Fri, Jan 31, 2020 at 08:06:52AM +0300, Dan Carpenter wrote: > > > We changed this from dev_err() to dev_WARN() in commit 0cb54a3e47cb > > > ("USB: debugging code shouldn't alter control flow"). > > > > > > The difference between dev_WARN() and dev_err() is that dev_WARN() > > > prints a stack trace and if you have panic on OOPS enabled then it leads > > > to a panic. The dev_err() function just prints the error message. > > > > > > Back in the day we didn't have usb emulators fuzz testing the kernel > > > so dev_WARN() didn't cause a problem for anyone, but these days the > > > dev_WARN() interferes with syzbot so let's change this to a dev_err(). > > > > > > Reported-by: syzbot+1bc2c2afd44f820a669f@syzkaller.appspotmail.com > > > Signed-off-by: Dan Carpenter > > > --- > > > > > > drivers/usb/core/urb.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c > > > index da923ec17612..0980c1d2253d 100644 > > > --- a/drivers/usb/core/urb.c > > > +++ b/drivers/usb/core/urb.c > > > @@ -475,7 +475,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) > > > > > > /* Check that the pipe's type matches the endpoint's type */ > > > if (usb_urb_ep_type_check(urb)) > > > - dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", > > > + dev_err(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", > > > usb_pipetype(urb->pipe), pipetypes[xfertype]); > > > > Like others said, we should have the stack trace here. So can you > > change this to dev_warn() and a stacktrace? > > In fact we want both a stack trace and a syzbot notification, because > this particular error indicates a bug in a kernel driver. Therefore > dev_WARN is appropriate. Ok, nevermind, you are right we should fix up the driver if that happens. greg k-h