Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5792645rwb; Tue, 22 Nov 2022 05:07:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Ak5jAI3hC9G7IjLucgx4ocKEfLfKe9qU/0ZduFFAutngsZ480uK4iDMVxlTSV4TfGhRNn X-Received: by 2002:a17:902:bc43:b0:189:1e5:8424 with SMTP id t3-20020a170902bc4300b0018901e58424mr4157525plz.156.1669122442665; Tue, 22 Nov 2022 05:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669122442; cv=none; d=google.com; s=arc-20160816; b=VdZz31oeLNOH1Sp84PjNeox+5hfK7T1tYE1v7B80jUTiqI5dPGGevADM+NkT6fVzzO edPLT8khtYyeh7veVJo/rQjDIbHXlb8incmr1RnV/KIFRJ32Fsju779C0X8BLYebzUx4 HojjUa6WNwgsL4jLGg0eghCMkPUv1ztS9Vu5DPgbooxxr8Z6NyRIeHBgTdO+wP5yDyiw wtIXmNRhJOcJyaY8eFNQkKJcjClWO9MqQPSchyc1JlLLPIxEfWoFJc0xD56Fpi0DW7Ad KcS5B4N3cFxDwyjRp/k3FCcKteqjdSHP8fKjY7lPzohuWuXoqQC8aXcAJYCmDYAjtE3t xtLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=IHAfgJ73djg6A4T1LpyU3dCfCwN0zLnVfeuIqf5lwBM=; b=h4sfFQ0Vlj2FB97jju0TAQqL0aazmarIhhMvXm/oVecoNWauE1aXpDp0ykPLscProl Zxxj0gT+USP/pJSlC3uGr0z0gtXLeRT7xpJB33Y3N0N9qFLlvqFXWu1A5Lp+8QZ3PQGz yUjscufw2cEGF7xZpW3P2dTx3jxjulFzJhCTBOsOgvJrzklhfyzQ4tJnU+Tu8XZVNgn5 e0cA0ma3YiPHEzEGp2RC3/D1lhiWT51q3FOgtZEEMNVOETm84A0wy3Rrvz9CWpx/Rs7q NqGyMHaJvjYTRdh5GMi0Koix8fYLWYviaf9Zv7kY8eJwYfEhU1Cgh2GcnJQjlbtYP+cB 7qeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a17090a0c0900b00212d47deabesi12255398pjs.60.2022.11.22.05.07.08; Tue, 22 Nov 2022 05:07:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233606AbiKVL6R (ORCPT + 90 others); Tue, 22 Nov 2022 06:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233482AbiKVL6M (ORCPT ); Tue, 22 Nov 2022 06:58:12 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F54811A20 for ; Tue, 22 Nov 2022 03:58:03 -0800 (PST) Received: from dggpeml500026.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NGjRw2C5Kz15Mp6; Tue, 22 Nov 2022 19:57:32 +0800 (CST) Received: from dggpeml500003.china.huawei.com (7.185.36.200) by dggpeml500026.china.huawei.com (7.185.36.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 19:58:01 +0800 Received: from [10.174.177.173] (10.174.177.173) by dggpeml500003.china.huawei.com (7.185.36.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 22 Nov 2022 19:58:01 +0800 Message-ID: <55a7be14-6ebc-2ee8-34a2-98781b32e29c@huawei.com> Date: Tue, 22 Nov 2022 19:57:59 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [syzbot] KASAN: use-after-free Write in expire_timers Content-Language: en-US To: syzbot , , , , , , , , "liwei (GF)" References: <0000000000006ca1a705edff52cf@google.com> From: Yu Liao In-Reply-To: <0000000000006ca1a705edff52cf@google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.173] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500003.china.huawei.com (7.185.36.200) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/11/22 2:35, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: b6e7fdfd6f6a Merge tag 'iommu-fixes-v6.1-rc5' of git://git.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=11c28f95880000 > kernel config: https://syzkaller.appspot.com/x/.config?x=95fb379f123ba8ce > dashboard link: https://syzkaller.appspot.com/bug?extid=38ee3533e07da8749f85 > compiler: aarch64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 > userspace arch: arm64 Fix data race between virtual_ncidev_close() and virtual_ncidev_open(). #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b6e7fdfd6f6a --- a/drivers/nfc/virtual_ncidev.c +++ b/drivers/nfc/virtual_ncidev.c @@ -161,12 +161,8 @@ static int virtual_ncidev_close(struct inode *inode, struct file *file) if (state == virtual_ncidev_enabled) { state = virtual_ncidev_disabling; - mutex_unlock(&nci_mutex); - nci_unregister_device(ndev); nci_free_device(ndev); - - mutex_lock(&nci_mutex); } state = virtual_ncidev_disabled; --