Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1214527ybl; Tue, 13 Aug 2019 09:05:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSZKI8FJJrR6Mu3DgB/2gOeN5VkqG2MrJGivOMtf/adOoJKWfVO3Z9HQ2yIMaNSXOfMUcF X-Received: by 2002:a62:ab0a:: with SMTP id p10mr10604570pff.144.1565712311113; Tue, 13 Aug 2019 09:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565712311; cv=none; d=google.com; s=arc-20160816; b=Ry8cXbYkL89R27NtbIWv5t9x8nTTB9ZbhF9DHYSqdAUIIT+pWWTkBfNEtEsEBX4KeG N0rspx5rcMQzOSyhZgGpH2+1vFdkUXviTGSPOFxcCmZr2xxX3FJJCKsI7rpBvUMwJ4p7 bjBq9WLBoJEsic4d2wYOIaWdtHlxlXMb7AlESYbDYdQNTfp+8IIusX9IPa6Q6qervAtZ ubqaCaJS+sX5FetPuhsmAMwQCmFKlhPKtA4iDt0Cv2agYC0b1wFD8+fbItOk18hF4pBq UlI4K6utqdiXeNqlwqkRVZmvVTyrI7uhd9yKBOvDTeXByHtCcIQCdSwA7WPrDdmZoFZe ++zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ftBFYEynUrG71VYjZU1HexLV5i8GQkTYaQFk1n/5Tno=; b=Uh9YSPz4GNv8TP//IwZ7ruBkaUhuIFRilVBe/c3UKEZycffkQuBDyWNeuCW3V358I6 /qiJUoCN1Og/jZkIVi9vZaKdR3oCD8ZXJHV6OkzJtPCdj8p6hhFZWc+2XaC+WtQGCq0N XijSw/IGWCfBuWdUu1hudj4I/pOV96uG1N6oZjtYIXf8pfrf05okR0BdDV4jr0IX/E+E t8moUrTYQIYbTVwzWkQzFs70xbkoeQWxu6nQT+FLTp/xcPdtr7ZCOjBDR68ZPv4a1FS/ OZ2S+NrFi2hXwDWvmffJSiW3bP0C91DLJ98Vt4jwFiPTZ4WlpJaQYSwlfe69n5/yxhZS ezUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=mJDQrkSU; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn16si132218plb.97.2019.08.13.09.04.55; Tue, 13 Aug 2019 09:05:11 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=mJDQrkSU; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729315AbfHMN7v (ORCPT + 99 others); Tue, 13 Aug 2019 09:59:51 -0400 Received: from mail-pl1-f170.google.com ([209.85.214.170]:39143 "EHLO mail-pl1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbfHMN7u (ORCPT ); Tue, 13 Aug 2019 09:59:50 -0400 Received: by mail-pl1-f170.google.com with SMTP id z3so2504397pln.6 for ; Tue, 13 Aug 2019 06:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ftBFYEynUrG71VYjZU1HexLV5i8GQkTYaQFk1n/5Tno=; b=mJDQrkSUMldAyUvXs55XlGqmDLCH0aQpx7ChM9DX7T0b4BiZ6SrfNoA+Lx4nAfZ5ig Om614mrZQMK4EtryDxkjvS+etMcGQVgnqSJRY9Tl1JVksKV1jAZ2ruA+Q9P2KrSClOsf tOitY9VIpO4hVU9KLbd87AVOTw7gU76RSNTcfT+HGxFannGCeW4/7HD9oXkg9abMxPBp 9+82LRdnnlyPHo4sGk1FiUjvxTLFRX5cI+99QAr5gMehrDjNzZCz9wrechG4MmXVGIrm EcbufeJ4F+WFBdiB6Sob6yXdlp4c8KnPZGeQNY3qpUHzCZcUo7NXAILbmistl2UHjXtB UfPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ftBFYEynUrG71VYjZU1HexLV5i8GQkTYaQFk1n/5Tno=; b=OijQOPAiPdHpsDfTNgHGV3+yheEIsqnP5ZZ1iN/0XiV+Uxg6+0a2UHXu+1fQiFTaA+ sSOR9IJleJpvHQomQ9dvHFUDLgdzfvgqhxwEX3yeUBNYgBmL77c8OBEFsR7czDhhzCz2 6DWQZ2vfVLtW3t+Y7YSi/9UcEm3cKv9odBNblTs7+EjwzcdQ3W9npJnaL2Pm+5WbvnZ4 ZaaVV9Y04NrOvt+wdZoxYkTIvG1oWYHfcn/xTfqFxcpcmBWkN4jccVho0BZAmeXJPKBA XmnTFxmYrXO4dIvDo3MlqEfTuPy0dGYsugPG4EV3VTU6NoqpmauGD0fRCIUD5Fk8Xs5t d74g== X-Gm-Message-State: APjAAAW50Fkgrtat9Uh+xqoa5c8Fj7CwqFp2D0kH4Pzb48OOlCDVoanj 6BjqvTZDm1RHPUDmKHQ7sn9tUBk0i8e6pFI7gjGdnruZiMKK/w== X-Received: by 2002:a17:902:ab96:: with SMTP id f22mr31893761plr.147.1565704789671; Tue, 13 Aug 2019 06:59:49 -0700 (PDT) MIME-Version: 1.0 References: <1565095011.8136.20.camel@suse.com> <1565185131.15973.1.camel@suse.com> In-Reply-To: From: Andrey Konovalov Date: Tue, 13 Aug 2019 15:59:38 +0200 Message-ID: Subject: Re: KASAN: use-after-free Read in device_release_driver_internal To: syzbot Cc: syzkaller-bugs , Alan Stern , LKML , USB list , Oliver Neukum Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 7, 2019 at 3:44 PM Andrey Konovalov wrote: > > On Wed, Aug 7, 2019 at 3:44 PM Andrey Konovalov wrote: > > > > On Wed, Aug 7, 2019 at 3:38 PM Oliver Neukum wrote: > > > > > > Am Dienstag, den 06.08.2019, 14:50 +0200 schrieb Andrey Konovalov: > > > > On Tue, Aug 6, 2019 at 2:36 PM Oliver Neukum wrote: > > > > > > > > > > Am Donnerstag, den 01.08.2019, 14:47 -0400 schrieb Alan Stern: > > > > > > > > > > > > I think this must be caused by an unbalanced refcount. That is, > > > > > > something must drop one more reference to the device than it takes. > > > > > > That would explain why the invalid access occurs inside a single > > > > > > bus_remove_device() call, between the klist_del() and > > > > > > device_release_driver(). > > > > > > > > > > > > The kernel log indicates that the device was probed by rndis_wlan, > > > > > > rndis_host, and cdc_acm, all of which got errors because of the > > > > > > device's bogus descriptors. Probably one of them is messing up the > > > > > > refcount. > > > > > > > > > > Hi, > > > > > > > > > > you made me look at cdc-acm. I suspect > > > > > > > > > > cae2bc768d176bfbdad7035bbcc3cdc973eb7984 ("usb: cdc-acm: Decrement tty port's refcount if probe() fail") > > > > > > > > > > is buggy decrementing the refcount on the interface in destroy() > > > > > even before the refcount is increased. > > > > > > > > > > Unfortunately I cannot tell from the bug report how many and which > > > > > interfaces the emulated test device has. Hence it is unclear to me, > > > > > when exactly probe() would fail cdc-acm. > > > > > > > > > > If you agree. I am attaching a putative fix. > > > > > > > > Let's see if it fixes the issue. > > > > > > > > #syz fix: https://github.com/google/kasan.git 6a3599ce > > > > > > Hi, > > > > > > did this ever produce a result? I saw none. > > > > Hm, that's weird, maybe that's caused by putting the bot into CC. Let > > me try that again. > > > > #syz fix: https://github.com/google/kasan.git 6a3599ce Let's fix the wrong title displayed on dashboard: #syz fix: usb: cdc-acm: make sure a refcount is taken early enough > > Oh, wait, it should be syz test =) > > #syz test: https://github.com/google/kasan.git 6a3599ce > > > > > > > > > Regards > > > Oliver > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group. > > > To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com. > > > To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-bugs/1565185131.15973.1.camel%40suse.com.