Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14485965pxu; Tue, 5 Jan 2021 02:56:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsyji3QFezj30pnnCZD/IL5uIChiEMXI5wo/6/ReDclkEqBGhoOg3Wj3JZ/kuAt2K/YCTc X-Received: by 2002:a50:8d89:: with SMTP id r9mr72598305edh.144.1609844190119; Tue, 05 Jan 2021 02:56:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609844190; cv=none; d=google.com; s=arc-20160816; b=0E83qMFE3sSx1Cv5w2gXLYl4NJe3KQGCjGnJdJ9HfgBXqGcp72m6GvDSRTvdlUG6jt V6UPBxW8XKktbqnEEepN+k4VsynppmTO1BNbPkWWOp4u6vXl4wLadNf3tcCIqoDmCk+o IeQ1pBLH3JCGlMB9BJSI5g0mEclQMjnTxhzT4HUimysyPEw/Jk0R32tb//BsHr8TneRs ZCtqlQFEeyDUpPaDbQ+weEM1sHuVm4OWI+LKIjSXlngmo7OqHB7I8nqlvkuA/dLs7oAP gu2A6TyIFQYt3FVSSKVI6maXfdGDJatvi7jS7G7PEiZEvouSwt51sRUVEPiJ12VWjJ3Q Kf8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id :dkim-signature; bh=ctvgyyVLZwmab3QcFSKJMVqA4L0pIOmLRRQPugBuOjA=; b=bGV5GbqUNbD7NFZCf8LIU5kol+ytQ1K4S6djHfGxD70yizBmzAcLLSk3dxInbpubN7 SIHH1Nde+TWiTpHA66jt3P1sxyXSbGn4SaRfDKimPGqeSoBL6scYJC5ArSThFO7p1dfv WjOyexvLK6FPRwzw4JgsGJTR6igifpPsvNw1NqOOS+9B4uX/tZ4C5+sbSONal0Y52rIq SIFR2QO9v2FtLRGZDeyG6VLQhFsVh2Nw2V27yIwq5qzC001Mme8srQLBeBlBg5v2Qser 9FDeOuUaIIPx6d6q6C0fHVOu9mV8tWXz8EKIznEYOkbKhiY9DCm1P3B9jw0Zj6M31dA9 g+qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=dOi2ZlD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r20si33338360edi.479.2021.01.05.02.56.06; Tue, 05 Jan 2021 02:56:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=dOi2ZlD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729178AbhAEKw1 (ORCPT + 99 others); Tue, 5 Jan 2021 05:52:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:60328 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbhAEKw1 (ORCPT ); Tue, 5 Jan 2021 05:52:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1609843899; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ctvgyyVLZwmab3QcFSKJMVqA4L0pIOmLRRQPugBuOjA=; b=dOi2ZlD73n5Gj8nhG2gCLg7GfoHsZIMlE565LwSspgL27LwmpOxKFHdOMUokOc2uQrQGLH RdnY3l25/m5wlVlveEUJwV7JVBpJzDURvMOQcJDjiELHLWaUQz6JjIliO1FUn6QA/Y7DAW BQJAUcC/RKKsdfsytrTGilDfrGGHUjA= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 90025AD0B; Tue, 5 Jan 2021 10:51:39 +0000 (UTC) Message-ID: Subject: Re: =?UTF-8?Q?=E5=9B=9E=E5=A4=8D=3A?= KASAN: use-after-free Read in service_outstanding_interrupt From: Oliver Neukum To: "Zhang, Qiang" , syzbot , "andreyknvl@google.com" , "gregkh@linuxfoundation.org" , "gustavoars@kernel.org" , "ingrassia@epigenesys.com" , "lee.jones@linaro.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "penguin-kernel@I-love.SAKURA.ne.jp" , "syzkaller-bugs@googlegroups.com" Date: Tue, 05 Jan 2021 11:51:31 +0100 In-Reply-To: References: <000000000000994d2a05b6b49959@google.com> ,<6a56df508f597d38746878e80e1f159a556d3152.camel@suse.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Dienstag, den 05.01.2021, 04:50 +0000 schrieb Zhang, Qiang: > > ________________________________________ > 发件人: Oliver Neukum > 发送时间: 2021年1月5日 0:28 > 收件人: syzbot; andreyknvl@google.com; gregkh@linuxfoundation.org; gustavoars@kernel.org; ingrassia@epigenesys.com; lee.jones@linaro.org; linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org; penguin-kernel@I-love.SAKURA.ne.jp; syzkaller-bugs@googlegroups.com > 主题: Re: KASAN: use-after-free Read in service_outstanding_interrupt > > Am Donnerstag, den 17.12.2020, 19:21 -0800 schrieb syzbot: > > syzbot has found a reproducer for the following issue on: > > > > HEAD commit: 5e60366d Merge tag 'fallthrough-fixes-clang-5.11-rc1' of g.. > > git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing > > console output: https://syzkaller.appspot.com/x/log.txt?x=12c5b623500000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=5cea7506b7139727 > > dashboard link: https://syzkaller.appspot.com/bug?extid=9e04e2df4a32fb661daf > > compiler: gcc (GCC) 10.1.0-syz 20200507 > > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=175adf07500000 > > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1672680f500000 > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: >syzbot+9e04e2df4a32fb661daf@syzkaller.appspotmail.com > > > > #syz test: https://github.com/google/kasan.git 5e60366d > > > > Hello Oliver > > this use-after-free still exists,It can be seen from calltrace that it is > usb_device's object has been released when disconnect, > can add a reference count to usb_device's object to avoid this problem Hi, thanks for your analysis. I think you are correct in your analysis, but I am afraid your fix is not correct. The driver is submitting an URB to a disconnected device. Your fix would prevent a crash, which is definitely good, but we still cannot do that, because the device may be owned by another driver or usbfs at that time. Regards Oliver