From: Alan Stern <stern@rowland.harvard.edu>
To: syzbot <syzbot+35f4d916c623118d576e@syzkaller.appspotmail.com>
Cc: Thinh.Nguyen@synopsys.com, <andreyknvl@google.com>,
<dianders@chromium.org>, <gregkh@linuxfoundation.org>,
<jflat@chromium.org>, <kai.heng.feng@canonical.com>,
<linux-kernel@vger.kernel.org>, <linux-usb@vger.kernel.org>,
<malat@debian.org>, <mathias.nyman@linux.intel.com>,
<nsaenzjulienne@suse.de>, <syzkaller-bugs@googlegroups.com>
Subject: Re: KASAN: slab-out-of-bounds Read in usb_reset_and_verify_device
Date: Tue, 3 Sep 2019 15:03:45 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44L0.1909031501550.1859-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <000000000000318cba0591a4f143@google.com>
On Tue, 3 Sep 2019, syzbot wrote:
> Hello,
>
> syzbot found the following crash on:
>
> HEAD commit: eea39f24 usb-fuzzer: main usb gadget fuzzer driver
> git tree: https://github.com/google/kasan.git usb-fuzzer
> console output: https://syzkaller.appspot.com/x/log.txt?x=174761b6600000
> kernel config: https://syzkaller.appspot.com/x/.config?x=d0c62209eedfd54e
> dashboard link: https://syzkaller.appspot.com/bug?extid=35f4d916c623118d576e
> compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1706275a600000
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+35f4d916c623118d576e@syzkaller.appspotmail.com
>
> ==================================================================
> BUG: KASAN: slab-out-of-bounds in memcmp+0xa6/0xb0 lib/string.c:904
> Read of size 1 at addr ffff8881d175bed6 by task kworker/0:3/2746
>
> CPU: 0 PID: 2746 Comm: kworker/0:3 Not tainted 5.3.0-rc5+ #28
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> Workqueue: usb_hub_wq hub_event
> Call Trace:
> __dump_stack lib/dump_stack.c:77 [inline]
> dump_stack+0xca/0x13e lib/dump_stack.c:113
> print_address_description+0x6a/0x32c mm/kasan/report.c:351
> __kasan_report.cold+0x1a/0x33 mm/kasan/report.c:482
> kasan_report+0xe/0x12 mm/kasan/common.c:612
> memcmp+0xa6/0xb0 lib/string.c:904
> memcmp include/linux/string.h:400 [inline]
> descriptors_changed drivers/usb/core/hub.c:5579 [inline]
> usb_reset_and_verify_device+0x564/0x1300 drivers/usb/core/hub.c:5729
Diagnostic patch.
#syz test: https://github.com/google/kasan.git eea39f24
Index: usb-devel/drivers/usb/core/hub.c
===================================================================
--- usb-devel.orig/drivers/usb/core/hub.c
+++ usb-devel/drivers/usb/core/hub.c
@@ -5721,6 +5721,13 @@ static int usb_reset_and_verify_device(s
if (ret < 0)
goto re_enumerate;
+ if (bos)
+ dev_info(&udev->dev, "Old BOS %p Len 0x%x\n",
+ bos, le16_to_cpu(bos->desc->wTotalLength));
+ if (udev->bos)
+ dev_info(&udev->dev, "New BOS %p Len 0x%x\n",
+ udev->bos, le16_to_cpu(udev->bos->desc->wTotalLength));
+
/* Device might have changed firmware (DFU or similar) */
if (descriptors_changed(udev, &descriptor, bos)) {
dev_info(&udev->dev, "device firmware changed\n");
next prev parent reply other threads:[~2019-09-03 19:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-03 12:08 KASAN: slab-out-of-bounds Read in usb_reset_and_verify_device syzbot
2019-09-03 19:03 ` Alan Stern [this message]
2019-09-03 19:20 ` syzbot
2019-09-03 19:33 ` Alan Stern
2019-09-03 19:58 ` syzbot
2019-09-03 20:58 ` Alan Stern
2019-09-03 21:13 ` syzbot
2019-09-04 14:41 ` Alan Stern
2019-09-04 14:59 ` syzbot
2019-09-04 15:01 ` Andrey Konovalov
2019-09-04 15:23 ` Alan Stern
2019-09-04 15:56 ` [PATCH] USB: usbcore: Fix slab-out-of-bounds bug during device reset Alan Stern
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=Pine.LNX.4.44L0.1909031501550.1859-100000@iolanthe.rowland.org \
--to=stern@rowland.harvard.edu \
--cc=Thinh.Nguyen@synopsys.com \
--cc=andreyknvl@google.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jflat@chromium.org \
--cc=kai.heng.feng@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=malat@debian.org \
--cc=mathias.nyman@linux.intel.com \
--cc=nsaenzjulienne@suse.de \
--cc=syzbot+35f4d916c623118d576e@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).