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:33:23 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.44L0.1909031531040.1859-100000@iolanthe.rowland.org> (raw)
In-Reply-To: <0000000000009290140591aaf9e7@google.com>
On Tue, 3 Sep 2019, syzbot wrote:
> Hello,
>
> syzbot has tested the proposed patch but the reproducer still triggered
> crash:
> KASAN: slab-out-of-bounds Read in usb_reset_and_verify_device
>
> usb 4-1: Old BOS 00000000ffd70172 Len 0xa8
> usb 4-1: New BOS 00000000b6d58371 Len 0xa8
> ==================================================================
> BUG: KASAN: slab-out-of-bounds in memcmp+0xa6/0xb0 lib/string.c:904
> Read of size 1 at addr ffff8881cd95d876 by task kworker/0:4/2841
Argh -- I forgot about printk's kernel-address mangling. Let's try
again.
Alan Stern
#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 %px Len 0x%x\n",
+ bos, le16_to_cpu(bos->desc->wTotalLength));
+ if (udev->bos)
+ dev_info(&udev->dev, "New BOS %px 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:33 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
2019-09-03 19:20 ` syzbot
2019-09-03 19:33 ` Alan Stern [this message]
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.1909031531040.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).