Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2386549ybe; Tue, 3 Sep 2019 12:05:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSUei2gsQwCnZFFJoClonwxCSNx2gpSZFxLT7QX+UbCOgDc5sO4gQdQvQU/O0mvd1LANAd X-Received: by 2002:a63:c70d:: with SMTP id n13mr31422206pgg.171.1567537514740; Tue, 03 Sep 2019 12:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567537514; cv=none; d=google.com; s=arc-20160816; b=ppMs7dep1CdbSgWEdMFbqf3VZ9YkUoE5ywCqQQ9qcrH9xPKGlBWXZK6F5Mc9T5KVQZ sJ4xsoVehI4RP+ynH/jyEskOX3mVCBylid/bIlnzD9bZRlf4kdt6WSIMpOtaN4yAisIA 1AL/RBSHzYEwxHaR8uskLH9eibU+mbvlPJh3ASCMpMnTOeXC4ypQkGYsPg6g+Hrpiio+ nEtpIYPqa6GbeOuSXIXq7+dnA/AiD1PDKdGftPe09f051+ntgk4DDeLc75NITXklaNxt X+66WPRgoIuxxXhNpg4NsS/JwZcfZVvY984DfQMJjDtzXW0bmgK8tw9M6FGK/0AHS8m/ dAFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=dsonxioAX9TLuisB6iwylakk3cad6PpmqVzYFHHbF8U=; b=X7H7CTmasFxuTV/cEH0ml8NrIAmUgiGMyKysFDIPg6Fk2tebYI92/q7AeLRDLhlFc8 m7PXrSN4iBcnI/UkcxRe6/6g0C3iYOw2Y6e0ntseu25aL01BfYhllPVM6iS1CWKix7j1 TMUTacV3VQd6Fmbg/NSEtCO7YYCud7xTbzDieuFnEbyjVIV5Z9WolIn6cFfsImPj5TYc OXckiH97Y+XgeX6MQ6aMakTQ+iFbWcl5KIlCjck3qovbc9egMK405ayLm3azeZgAIRIT 4BYcBfQRRvowEIqs0BuCscqlnMAZXWl8+KeBjvSHc7OZuW18BpKP+yU7+JPDb33MVnIm kJSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si14892491pgp.78.2019.09.03.12.04.58; Tue, 03 Sep 2019 12:05:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbfICTDq (ORCPT + 99 others); Tue, 3 Sep 2019 15:03:46 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:33562 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725882AbfICTDq (ORCPT ); Tue, 3 Sep 2019 15:03:46 -0400 Received: (qmail 7198 invoked by uid 2102); 3 Sep 2019 15:03:45 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 3 Sep 2019 15:03:45 -0400 Date: Tue, 3 Sep 2019 15:03:45 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: syzbot cc: Thinh.Nguyen@synopsys.com, , , , , , , , , , , Subject: Re: KASAN: slab-out-of-bounds Read in usb_reset_and_verify_device In-Reply-To: <000000000000318cba0591a4f143@google.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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");