linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Konovalov <andreyknvl@google.com>
To: syzbot <syzbot+1b2449b7b5dc240d107a@syzkaller.appspotmail.com>
Cc: syzkaller-bugs <syzkaller-bugs@googlegroups.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	LKML <linux-kernel@vger.kernel.org>,
	USB list <linux-usb@vger.kernel.org>,
	Oliver Neukum <oneukum@suse.com>
Subject: Re: KASAN: use-after-free Read in device_release_driver_internal
Date: Tue, 13 Aug 2019 15:59:38 +0200	[thread overview]
Message-ID: <CAAeHK+zsA=O0bgSHij5Opx-RhknnQEhj+2VoCCjLcVRc5Q-=Zg@mail.gmail.com> (raw)
In-Reply-To: <CAAeHK+zDVmxgjkZ6dR-sk1=99-Aj=Z4wwxaRCaOXeuYYG3-bUw@mail.gmail.com>

On Wed, Aug 7, 2019 at 3:44 PM Andrey Konovalov <andreyknvl@google.com> wrote:
>
> On Wed, Aug 7, 2019 at 3:44 PM Andrey Konovalov <andreyknvl@google.com> wrote:
> >
> > On Wed, Aug 7, 2019 at 3:38 PM Oliver Neukum <oneukum@suse.com> wrote:
> > >
> > > Am Dienstag, den 06.08.2019, 14:50 +0200 schrieb Andrey Konovalov:
> > > > On Tue, Aug 6, 2019 at 2:36 PM Oliver Neukum <oneukum@suse.com> wrote:
> > > > >
> > > > > Am Donnerstag, den 01.08.2019, 14:47 -0400 schrieb Alan Stern:
> > > > > >
> > > > > > I think this must be caused by an unbalanced refcount.  That is,
> > > > > > something must drop one more reference to the device than it takes.
> > > > > > That would explain why the invalid access occurs inside a single
> > > > > > bus_remove_device() call, between the klist_del() and
> > > > > > device_release_driver().
> > > > > >
> > > > > > The kernel log indicates that the device was probed by rndis_wlan,
> > > > > > rndis_host, and cdc_acm, all of which got errors because of the
> > > > > > device's bogus descriptors.  Probably one of them is messing up the
> > > > > > refcount.
> > > > >
> > > > > Hi,
> > > > >
> > > > > you made me look at cdc-acm. I suspect
> > > > >
> > > > > cae2bc768d176bfbdad7035bbcc3cdc973eb7984 ("usb: cdc-acm: Decrement tty port's refcount if probe() fail")
> > > > >
> > > > > is buggy decrementing the refcount on the interface in destroy()
> > > > > even before the refcount is increased.
> > > > >
> > > > > Unfortunately I cannot tell from the bug report how many and which
> > > > > interfaces the emulated test device has. Hence it is unclear to me,
> > > > > when exactly probe() would fail cdc-acm.
> > > > >
> > > > > If you agree. I am attaching a putative fix.
> > > >
> > > > Let's see if it fixes the issue.
> > > >
> > > > #syz fix: https://github.com/google/kasan.git 6a3599ce
> > >
> > > Hi,
> > >
> > > did this ever produce a result? I saw none.
> >
> > Hm, that's weird, maybe that's caused by putting the bot into CC. Let
> > me try that again.
> >
> > #syz fix: https://github.com/google/kasan.git 6a3599ce

Let's fix the wrong title displayed on dashboard:

#syz fix: usb: cdc-acm: make sure a refcount is taken early enough

>
> Oh, wait, it should be syz test =)
>
> #syz test: https://github.com/google/kasan.git 6a3599ce
>
> >
> > >
> > >         Regards
> > >                 Oliver
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/1565185131.15973.1.camel%40suse.com.

  parent reply	other threads:[~2019-08-13 13:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 14:28 KASAN: use-after-free Read in device_release_driver_internal syzbot
2019-08-01 16:01 ` Andrey Konovalov
2019-08-01 18:47   ` Alan Stern
2019-08-06 12:36     ` Oliver Neukum
2019-08-06 12:50       ` Andrey Konovalov
2019-08-07 13:38         ` Oliver Neukum
2019-08-07 13:44           ` Andrey Konovalov
2019-08-07 13:44             ` Andrey Konovalov
2019-08-07 13:45               ` Andrey Konovalov
2019-08-07 14:13                 ` syzbot
2019-08-07 13:56               ` syzbot
2019-08-07 17:40                 ` Alan Stern
2019-08-07 17:51                   ` syzbot
2019-08-07 18:05                     ` Alan Stern
2019-08-07 18:23                       ` syzbot
2019-08-07 18:31                         ` Alan Stern
2019-08-08 12:27                           ` Andrey Konovalov
2019-08-08 12:43                             ` Dmitry Vyukov
2019-08-08 13:03                               ` Andrey Konovalov
2019-08-08 13:59                                 ` Alan Stern
2019-08-13 12:42                                   ` Andrey Konovalov
2019-08-13 13:22                                     ` Oliver Neukum
2019-08-13 13:24                                       ` Andrey Konovalov
2019-08-13 15:16                                       ` Greg KH
2019-08-13 13:59               ` Andrey Konovalov [this message]
2019-08-06 14:19       ` Alan Stern
2019-08-06 14:25         ` Oliver Neukum
2019-08-06 15:33         ` Oliver Neukum
2019-08-07 13:46           ` Andrey Konovalov

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='CAAeHK+zsA=O0bgSHij5Opx-RhknnQEhj+2VoCCjLcVRc5Q-=Zg@mail.gmail.com' \
    --to=andreyknvl@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+1b2449b7b5dc240d107a@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).