Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4140659ybv; Mon, 10 Feb 2020 13:11:28 -0800 (PST) X-Google-Smtp-Source: APXvYqx4MuPj9JKeEolaTKy75wQhC8bJVsCPAJGrvVNcSCNCrJ9L9Ec/3d2uWiUZx1TVZfl5jEz6 X-Received: by 2002:aca:fcc1:: with SMTP id a184mr706493oii.36.1581369088495; Mon, 10 Feb 2020 13:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581369088; cv=none; d=google.com; s=arc-20160816; b=KYkXTSzno92fhYhqP+W6uOSJfx+5AtY2PJKb9bnTE7De6qDPLNHxbBpXVZ53cm8WkR emIcj27rJ3WzZUFDjtIfn8TyKAunrHa+tOrtk4os1ASoQoM9iCmmfVd4qhNca+1pmMvq E2ODAZ4FgpYUq1m6u2gdn7H+f9PNqfHHyaOAz92QjxAnN9IafMOeAJxGLlRCZuWRkvdP bYMXxYlqviPd/THM185MEF46KBstOqeTkBKD4qqQ73BOvX7jevTfzm/N604ZpBuC4Ffc 3leQb3KUtMBy4hrRB0v9M0AYqVa7D4CiEAdZ4iKtzpWB81klU4oO9+sMsIpUfXZ/+0An v0aA== 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=ueFChRoAADogzAgP84HhHGd2D7OjemghL0rmB+2m5Ow=; b=Ke9QRGgJX6q6inINM2t90XiapVDC0lbbffi9xNLp/OaerAuyVaYpiaR9q18CI+Wkgi xdsrxbX1ruV1RkU+TCtXqt+mpUVLjQoAhYKx+dYmYo/dLI45zb9xDeSu+O/WvJtCxqx7 +ID+I+L/pzBM5/TuwH7xVE0gQvdaPpxL6T/wJURSvcUTp2K9pzL+1/ojcncz/hdR5YiK YnUeIzivz090j7QwDgGlZ+F4T1rBChwN78tw1g6UcbziSJ9AoiRTIoRlIg3zkiq1cUJI irbscn/t/hHjqtEoHV6CMat6MguUOKU3Wf68xzHViropIzUh08kRyl9Gm+sKwHl9uxen JJqA== 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 z2si653792oix.100.2020.02.10.13.11.15; Mon, 10 Feb 2020 13:11:28 -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 S1727414AbgBJVLM (ORCPT + 99 others); Mon, 10 Feb 2020 16:11:12 -0500 Received: from netrider.rowland.org ([192.131.102.5]:36421 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727056AbgBJVLL (ORCPT ); Mon, 10 Feb 2020 16:11:11 -0500 Received: (qmail 15433 invoked by uid 500); 10 Feb 2020 16:11:10 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Feb 2020 16:11:10 -0500 Date: Mon, 10 Feb 2020 16:11:10 -0500 (EST) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Greg KH cc: Dan Carpenter , syzbot , , , , , Subject: Re: [PATCH] usb: core: urb: change a dev_WARN() to dev_err() for syzbot In-Reply-To: <20200210190419.GC1058087@kroah.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 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. Alan Stern > thanks, > > greg k-h