Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2420255ybe; Tue, 3 Sep 2019 12:34:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZFC47cDSLNrsQuKFzpO1OnsY+aHIxyg1g18H8p6+DFbFtmxiHJ0uwjQvvt437+MyDnNKN X-Received: by 2002:a17:902:7088:: with SMTP id z8mr6741175plk.307.1567539293229; Tue, 03 Sep 2019 12:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567539293; cv=none; d=google.com; s=arc-20160816; b=fJRvgco92uo+fYdRIYHBWZHjeEfcyCTk8SC0VfYk3W+IAjKuxtggoPfvsHAtyMI+XE whxBQfixEBJV50WuK4E8oshcfLmeki2KyXf5xxige+1hsaX0PIt7C+MUv99VkeaOlcFU Tvd3jSyO9UwpKJMZeDiFB48FL3y+A+jU0sRsv7Ju5dw3uCINexDjm9IdB8uEthPk91Wz rX/kvxjM1wE5WRKmjFBho6C+u3pw0OQ98yfkVdgQwvD7wYyo9Tab9CJg3c8iEZZ7k7Ei W1gs6Yx3MEVaPQFgLnC+m+7ubOaRvppaU5aJ1f0iTZSY5ulHkx8SmauPjIJOTmw49obh 31Hg== 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=T6nlzwKZJ8ENVneQBWM9Uvzuy4+cj8qj6DQ0FdSI5sw=; b=Nn0avNS4gm24OlzKOQc/Jyc2emJiFLQ5XMQHqeyH4tLFnqPeWZeV/aURXTagpNofPf 01Ckcr86p8CaZ0Ei1Z8WrG6whB6ugO/Sxnc7EaPeg9e19jZXYCe3I3koabMqHnfMUjNs iOO0GnYKT7Ru8sB7bjaiJKNIB3uoxJhw9cnRFceO5wVpoGUnB8cIWuH3weo5MFhohCrh 3FsIT7z1VySqF3+bzSseTw2IebZicaK+RXW/3GDh7ttC74nIqTgevehMiJFJlUaUAJ6M C9D+zSo/lqDN0eR8cb1w1mByjW8HsgbrShrk0w/ePIXjLPpDsHc8PWCtFnrHjSdcgRcs FC4w== 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 o18si10714223pll.302.2019.09.03.12.34.37; Tue, 03 Sep 2019 12:34:53 -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 S1726534AbfICTdY (ORCPT + 99 others); Tue, 3 Sep 2019 15:33:24 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:33680 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726177AbfICTdY (ORCPT ); Tue, 3 Sep 2019 15:33:24 -0400 Received: (qmail 7621 invoked by uid 2102); 3 Sep 2019 15:33:23 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 3 Sep 2019 15:33:23 -0400 Date: Tue, 3 Sep 2019 15:33:23 -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: <0000000000009290140591aaf9e7@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 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");