Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5476865ybh; Wed, 7 Aug 2019 06:39:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2utO0ln0lE6MvM3176wmHaIt7LwpMoEyFd2bpdBYI58KL32LE1yTiAXcDH2wc8t6qf6lT X-Received: by 2002:a17:90b:8e:: with SMTP id bb14mr31015pjb.19.1565185188827; Wed, 07 Aug 2019 06:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565185188; cv=none; d=google.com; s=arc-20160816; b=m67LoQzUPwLKF7/sIogf5HcPIs8Gx4NyBV4Z4H4k7F2yH1jQEmeozHZjGopzRYHg/j e3r1USJP9jJenkZPwL0q4xJQiGcjnYtCBiNKA05hv4PhfWpnQ218TshKOgsQjXRRh3HZ fulwHmH0K9fmtytjckHKfONOYfi49A6BORYTm6RRa5twomvxeZeyCiXL2QALnMM85UZF DnDHodSZbU4hFbQ7LCFlCwqXQYGL2cXXP8NKaWSSMkhamys2ZfoUjf/QApvAfbWOqq7S C9FZXecsHxZlBh7xO/n/7i0lI1c19B+MkoHjyDy0xqRvpBARYhHxV4SB+2ckUiapVmzO kbxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=s13deXQhtC2Cl8dqxK5SG26tAwQIWVfF8VZUvwAmrCE=; b=Jw1+6CTak4lRoamTLiM2yEasdRFp9uz1Lri3uuucl2HWj9m3osv84L5GC0wR2wyM8b DdLAjoC17dE5Tp/6xyp5IlcBrz1ca/Pe4sQF3SJihM2SWKg2zj1ZJKZQo7IxVk8xRyDu RJS46WOH4CPfZL0ly/NsQEnL0ozXxeI8V9SpsSTyFiPljj1HIE+jElPnKCvMMb7+TizH ghP9GWFQvUvUlVLskWg0OwyaPtW3HJxV3P95vxnF8/ygj1zcgvpTH9eqJkuXyZPr/heu Bz2Dl/xv+03O8YWGLUjE813li13vzy6+XHRrsgMZEceZ1q5NfFI6/r5oG+gl0c4H5t6T ZiIA== 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 o19si50322036pgj.120.2019.08.07.06.39.33; Wed, 07 Aug 2019 06:39:48 -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 S2388438AbfHGNiz (ORCPT + 99 others); Wed, 7 Aug 2019 09:38:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:42824 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388240AbfHGNiz (ORCPT ); Wed, 7 Aug 2019 09:38:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D56D9AEF3; Wed, 7 Aug 2019 13:38:53 +0000 (UTC) Message-ID: <1565185131.15973.1.camel@suse.com> Subject: Re: KASAN: use-after-free Read in device_release_driver_internal From: Oliver Neukum To: Andrey Konovalov Cc: syzkaller-bugs , Alan Stern , syzbot , LKML , USB list Date: Wed, 07 Aug 2019 15:38:51 +0200 In-Reply-To: References: <1565095011.8136.20.camel@suse.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards Oliver