linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	syzbot <syzbot+1bc2c2afd44f820a669f@syzkaller.appspotmail.com>,
	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
Date: Tue, 11 Feb 2020 09:03:42 +0300	[thread overview]
Message-ID: <20200211060342.GB1778@kadam> (raw)
In-Reply-To: <20200210190419.GC1058087@kroah.com>

On Mon, Feb 10, 2020 at 11:04:19AM -0800, 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 <dan.carpenter@oracle.com>
> > ---
> > 
> >  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?
> 

Let's just fix the driver instead.  That was the message I got from the
thread.

regards,
dan carpenter



  parent reply	other threads:[~2020-02-11  6:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-29 12:27 WARNING in ar5523_cmd/usb_submit_urb syzbot
2020-01-31  5:06 ` [PATCH] usb: core: urb: change a dev_WARN() to dev_err() for syzbot Dan Carpenter
2020-01-31 13:30   ` Johan Hovold
2020-01-31 13:39     ` Dan Carpenter
2020-02-10 19:04   ` Greg KH
2020-02-10 21:11     ` Alan Stern
2020-02-10 21:50       ` Greg KH
2020-02-11  6:03     ` Dan Carpenter [this message]
     [not found] ` <20200131090510.7112-1-hdanton@sina.com>
2020-01-31 10:16   ` Dan Carpenter
2020-01-31 11:19     ` Dmitry Vyukov
2020-01-31 13:37       ` Johan Hovold
2020-01-31 14:25       ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200211060342.GB1778@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=andreyknvl@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ingrassia@epigenesys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+1bc2c2afd44f820a669f@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).