[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1565095011.8136.20.camel@suse.com>
Date: Tue, 06 Aug 2019 14:36:51 +0200
From: Oliver Neukum <oneukum@...e.com>
To: Alan Stern <stern@...land.harvard.edu>,
Andrey Konovalov <andreyknvl@...gle.com>
Cc: syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
syzbot <syzbot+1b2449b7b5dc240d107a@...kaller.appspotmail.com>,
LKML <linux-kernel@...r.kernel.org>,
USB list <linux-usb@...r.kernel.org>
Subject: Re: KASAN: use-after-free Read in device_release_driver_internal
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.
Regards
Oliver
View attachment "0001-usb-cdc-acm-make-sure-a-refcount-is-taken-early-enou.patch" of type "text/x-patch" (1751 bytes)
Powered by blists - more mailing lists