Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6871846ybh; Thu, 8 Aug 2019 07:01:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwTGf/JDtoabbDPzYELvD71DGHZypUxR84EiBGmzAnqOOvlQpJvmP/1LJZT/fD8r812rsE X-Received: by 2002:a62:2d3:: with SMTP id 202mr15890937pfc.131.1565272861125; Thu, 08 Aug 2019 07:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565272861; cv=none; d=google.com; s=arc-20160816; b=sUdZIcPmFBjao0sTRtS5pBFo/WCz8um85lck/4+5D0lCOdxYM5YrtouboPrIORo+AQ RwWWAREWxBVyn+AWmqIeJiWTmUcmJQMb3nzqUZ30JWdX5F07wZXp6KrgmkgwWmrKXsRA 16fOkR69ibwMfecGTSrUMEaAhRcqzKrLpMhuFSl4kOCrM52u0uybqzAWlgEHpAoM0cFj Zw3+4M8PmmN9q9sYRXY4P/Jmqh9Qz+xmtc6aV3Rj4ekWFjsWxWAs4+nDFUot8ouILB3L BbuZ+RH8jirgA6e1hX3zvtetFc4jNRSDj/dB27k/ZJcvFwjHgNpdGec/I8NXOih4+VLj B6RA== 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=wXHCJxICLBSh00e8jq0uX0T8DjSATsMk720SQZm7Ivs=; b=Mu5kO4+h36pXTuyVUqEY8Lv2l4GBMRN+E6R6LbEUENdDux98GVuEz6OXTc59oZZx0d hCRn9Jwb6BQM+dDHc57VLZ5VwKW59i9vV+xJHpHJjeCsFFocx9lAu75W8B9UEsTuCt8t LaF3wdJxfwRKAntSnGyoAWNQ1/7yq/iqr+gNPb3KfMAb7H7lUosA8iC8EpwFAmTo5D6v EeCUrhWXj0NJgmSkxV5VbCjydE562ioPl/rkaZYFQffbZ/9eo+G2girxpPpxv1kP8t8n wuNCnG9vJ6Rq+NeBQOtEXt/khCLENf+5fDiXeHFm/fol/QplhUllvlD9hPxENIyRkSFU VxYQ== 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 k8si52945886pgt.548.2019.08.08.07.00.43; Thu, 08 Aug 2019 07:01:01 -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 S1733292AbfHHOAB (ORCPT + 99 others); Thu, 8 Aug 2019 10:00:01 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:41750 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1733005AbfHHOAA (ORCPT ); Thu, 8 Aug 2019 10:00:00 -0400 Received: (qmail 1781 invoked by uid 2102); 8 Aug 2019 09:59:59 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 8 Aug 2019 09:59:59 -0400 Date: Thu, 8 Aug 2019 09:59:59 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Andrey Konovalov cc: Dmitry Vyukov , syzbot , LKML , USB list , Oliver Neukum , syzkaller-bugs Subject: Re: KASAN: use-after-free Read in device_release_driver_internal In-Reply-To: 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 Thu, 8 Aug 2019, Andrey Konovalov wrote: > On Thu, Aug 8, 2019 at 2:44 PM Dmitry Vyukov wrote: > > > > On Thu, Aug 8, 2019 at 2:28 PM Andrey Konovalov wrote: > > > > > > On Wed, Aug 7, 2019 at 8:31 PM Alan Stern wrote: > > > > > > > > On Wed, 7 Aug 2019, syzbot wrote: > > > > > > > > > Hello, > > > > > > > > > > syzbot has tested the proposed patch and the reproducer did not trigger > > > > > crash: > > > > > > > > > > Reported-and-tested-by: > > > > > syzbot+1b2449b7b5dc240d107a@syzkaller.appspotmail.com > > > > > > > > > > Tested on: > > > > > > > > > > commit: 6a3599ce usb-fuzzer: main usb gadget fuzzer driver > > > > > git tree: https://github.com/google/kasan.git > > > > > kernel config: https://syzkaller.appspot.com/x/.config?x=700ca426ab83faae > > > > > compiler: gcc (GCC) 9.0.0 20181231 (experimental) > > > > > patch: https://syzkaller.appspot.com/x/patch.diff?x=132eec8c600000 > > > > > > > > > > Note: testing is done by a robot and is best-effort only. > > > > > > > > Andrey, is there any way to get the console output from this test? > > > > > > Dmitry, would it be possible to link console log for successful tests as well? > > > > Yes. Start by filing a feature request at > > https://github.com/google/syzkaller/issues > > Filed https://github.com/google/syzkaller/issues/1322 > > Alan, for now I've applied your patch and run the reproducer manually: > > [ 90.844643][ T74] usb 1-1: new high-speed USB device number 2 > using dummy_hcd > [ 91.085789][ T74] usb 1-1: Using ep0 maxpacket: 16 > [ 91.204698][ T74] usb 1-1: config 0 has an invalid interface > number: 234 but max is 0 > [ 91.209137][ T74] usb 1-1: config 0 has no interface number 0 > [ 91.211599][ T74] usb 1-1: config 0 interface 234 altsetting 0 > endpoint 0x8D has an inva1 > [ 91.216162][ T74] usb 1-1: config 0 interface 234 altsetting 0 > endpoint 0x7 has invalid 4 > [ 91.218211][ T74] usb 1-1: config 0 interface 234 altsetting 0 > bulk endpoint 0x7 has inv4 > [ 91.220131][ T74] usb 1-1: config 0 interface 234 altsetting 0 > bulk endpoint 0x8F has in0 > [ 91.222052][ T74] usb 1-1: New USB device found, idVendor=0421, > idProduct=0486, bcdDevic7 > [ 91.223851][ T74] usb 1-1: New USB device strings: Mfr=0, > Product=0, SerialNumber=0 > [ 91.233180][ T74] usb 1-1: config 0 descriptor?? > [ 91.270222][ T74] rndis_wlan 1-1:0.234: Refcount before probe: 3 > [ 91.275464][ T74] rndis_wlan 1-1:0.234: invalid descriptor buffer length > [ 91.277558][ T74] usb 1-1: bad CDC descriptors > [ 91.279716][ T74] rndis_wlan 1-1:0.234: Refcount after probe: 3 > [ 91.281378][ T74] rndis_host 1-1:0.234: Refcount before probe: 3 > [ 91.283303][ T74] rndis_host 1-1:0.234: invalid descriptor buffer length > [ 91.284724][ T74] usb 1-1: bad CDC descriptors > [ 91.286004][ T74] rndis_host 1-1:0.234: Refcount after probe: 3 > [ 91.287318][ T74] cdc_acm 1-1:0.234: Refcount before probe: 3 > [ 91.288513][ T74] cdc_acm 1-1:0.234: invalid descriptor buffer length > [ 91.289835][ T74] cdc_acm 1-1:0.234: No union descriptor, testing > for castrated device > [ 91.291555][ T74] cdc_acm 1-1:0.234: Refcount after probe: 3 > [ 91.292766][ T74] cdc_acm: probe of 1-1:0.234 failed with error -12 > [ 92.001549][ T96] usb 1-1: USB disconnect, device number 2 Ah, that looks right, thank you. The patch worked correctly -- good work Oliver! Alan Stern