Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
From: <Roderick.Colenbrander@sony.com>
To: <andreyknvl@google.com>
Cc: <jikos@kernel.org>, <stern@rowland.harvard.edu>,
	<gustavo@embeddedor.com>, <hdanton@sina.com>,
	<syzkaller-bugs@googlegroups.com>, <linux-input@vger.kernel.org>,
	<linux-usb@vger.kernel.org>
Subject: RE: [PATCH] HID: USB: Fix general protection fault caused by Logitech driver
Date: Tue, 3 Sep 2019 20:00:59 +0000
Message-ID: <1DD62093774CEE42AFC16E785A108804AC002291@USCULXMSG13.am.sony.com> (raw)
In-Reply-To: <CAAeHK+yissGc22RXh6t3KZxnGL=6_+PdP7LoQ_dvfALJcdQk8g@mail.gmail.com>

> From: Andrey Konovalov [andreyknvl@google.com]
> Sent: Tuesday, September 03, 2019 3:46 AM
> To: Colenbrander, Roderick
> Cc: Jiri Kosina; Alan Stern; Gustavo A. R. Silva; Hillf Danton; syzkaller-bugs; linux-input@vger.kernel.org; USB list
> Subject: Re: [PATCH] HID: USB: Fix general protection fault caused by Logitech driver

> On Sat, Aug 24, 2019 at 2:41 AM <Roderick.Colenbrander@sony.com> wrote:
>
> On Thu, 22 Aug 2019, Alan Stern wrote:
> >
> > > > > > > I've ran the fuzzer with your patches applied overnight and noticed
> > > > > > > another fallout of similar bugs. I think they are caused by a similar
> > > > > > > issue in the sony HID driver. There's no hid_hw_stop() call in the "if
> > > > > > > (!(hdev->claimed & HID_CLAIMED_INPUT))" case in sony_probe(). Does it
> > > > > > > look like a bug to you?
> > > > > >
> > > > > > It looks like the relevant hid_hw_stop() call is the one at the end of
> > > > > > sony_configure_input().  But I can't tell if doing that way is valid or
> > > > > > not -- in practice the code would end up calling hid_disconnect() while
> > > > > > hid_connect() was still running, which doesn't seem like a good idea.
> > > > > >
> > > > > > There's a comment about this near the end of sony_probe().  I suspect
> > > > > > it would be better to call hid_hw_stop() in the conditional code
> > > > > > following that comment rather than in sony_configure_input().
> > > > > >
> > > > > > Either way, these are all things Jiri should know about or check up on.
> > > > > >
> > > > > > Have you gotten any test results from syzbot exercising these pathways?
> > > > > > You ought to be able to tell which HID driver is involved by looking
> > > > > > through the console output.
> > > > >
> > > > > Yes, a typical crash is below, that's why I thought it's the sony
> > > > > driver. Adding hid_hw_stop() in sony_probe() stops the issue from
> > > > > happening, but I don't know whether it's the right fix.
> > > >
> > > > Probably you have to add hid_hw_stop() in sony_probe() and remove it
> > > > from sony_configure_input().  But like I said above, Jiri should look
> > > > into this.
> >
> > > It almost certainly is, thanks.
> >
> > > Adding Roderick to CC ... Roderick, will you be able to test and submit
> > > a patch fixing that?
> > >
> > > --
> > > Jiri Kosina
> > > SUSE Labs
> >
> > Sure we will have a look and do some testing. Hopefully we can share a patch some time next week.

> Hi Roderick,
> 
> I was wondering if you had a chance to look into this?
> 
> Once the Logitech fix is upstream, this similar Sony bug will start
> producing a large number of similar syzbot reports since it causes a
> major memory corruption and we'll need to triage them all again. It
> would be nice to get the Sony fix merged together with the Logitech
> one. Or at least to have it available so I can apply it manually until
> it is merged.
> 
> Thanks!

Hi Andrey,

We are still looking at the issue. I had one of my guys try the fix (and trigger an error in sony_input_configured), but he claimed he crashed his kernel. Due to the long weekend in the US, we didn't get back to looking at it yet. We are looking at it some more today or tomorrow.

Thanks,
Roderick

  reply index

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-29 11:48 WARNING in usbhid_raw_request/usb_submit_urb syzbot
2019-07-30 14:10 ` Alan Stern
2019-07-30 14:12   ` Andrey Konovalov
2019-07-30 14:24     ` Oliver Neukum
2019-07-30 16:58 ` syzbot
2019-08-12 12:46   ` Andrey Konovalov
2019-08-12 13:03     ` syzbot
2019-08-12 14:23       ` Andrey Konovalov
2019-08-13 20:13       ` Alan Stern
2019-08-21 12:51         ` Andrey Konovalov
2019-08-21 13:09           ` syzbot
2019-08-21 14:08             ` Andrey Konovalov
     [not found]     ` <20190812144720.1980-1-hdanton@sina.com>
2019-08-12 14:55       ` Andrey Konovalov
2019-08-12 15:06       ` general protection fault in __pm_runtime_resume syzbot
2019-08-15 17:43         ` Alan Stern
2019-08-20 20:00           ` [PATCH] HID: USB: Fix general protection fault caused by Logitech driver Alan Stern
2019-08-21 14:11             ` Andrey Konovalov
2019-08-22  7:53             ` Jiri Kosina
2019-08-22 12:32             ` Andrey Konovalov
2019-08-22 17:11               ` Alan Stern
2019-08-22 18:25                 ` Andrey Konovalov
2019-08-22 20:21                   ` Alan Stern
2019-08-23  9:29                     ` Jiri Kosina
2019-08-24  0:41                       ` Roderick.Colenbrander
2019-09-03 10:46                         ` Andrey Konovalov
2019-09-03 20:00                           ` Roderick.Colenbrander [this message]
     [not found]     ` <20190813042649.888-1-hdanton@sina.com>
2019-08-13  7:35       ` WARNING in usbhid_raw_request/usb_submit_urb Dmitry Vyukov
2019-08-13  8:14       ` Oliver Neukum

Reply instructions:

You may reply publically 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=1DD62093774CEE42AFC16E785A108804AC002291@USCULXMSG13.am.sony.com \
    --to=roderick.colenbrander@sony.com \
    --cc=andreyknvl@google.com \
    --cc=gustavo@embeddedor.com \
    --cc=hdanton@sina.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox