Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3130950pxb; Sat, 9 Oct 2021 02:36:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdeDPnCBlJlPAeveeH+yicFTWtRKeVD3hvST947cGZWZfTEpcjQ03F1LpaEWk+Z0UBOsZs X-Received: by 2002:a17:906:f85b:: with SMTP id ks27mr10997673ejb.430.1633772194821; Sat, 09 Oct 2021 02:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633772194; cv=none; d=google.com; s=arc-20160816; b=Lfh+r3N8Y+Q10JlgAlBwPN3/jJdFV9bkXNAwRgiJCY7Nt3hzqTG0ZzHKDG2NMRJCU7 9msX/IpU5Nyrh5EoxDvY3Gh+aT3MJlM0LSW5SBqV0JCN0Zk7w/VjA64hlqf0zxYDqp+D Efikv2bO+ekYvpF/5CNQCMbJflfK1z9PsHFA5eGH74+CrpjFs3TZtfM7MYtZDNtv7GES vCnqG9PgX+b69xKB9WaFx9W5nzisZ4vNAHLGmcsCYWii9+BpVP+mixO8iIeVkammlNKx ph/a3k/jMqp69GiCx1C+vduBju4clwcAl1+EP1YLlctd9BlXPjH2xmXepsz4LrMx1R09 gYSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=7IY4qjltBBdlTr98sksjzg/y+7xC6fkR5ODvbt90/sw=; b=M6EF34JwW/hwElzUrk3ScBsEXPPnLx8t/9Wg/US6hTweAGnLrOrqYgo7UhnQET+m5j 9LWJs2lXB9NJy5K/siTDXa+Pz3oezA0TpubyuAOLg6FeI2c6+iIiyj21e2LOsTchFBdG Kh+vZeSattRWZVYxwCoNNb7XP17iuBUKGmkJr0lTFfLchITWnRbGlfdPqIZS/G4SIgCU NMfOBeM4LaYOIoE08Lxc0i0VP9HfvfezwMAV7RInFreS/UvfQVsuhjBCpUjwkh4B1ANS Hfsaw8Mm9QWl2v6Fq7jXM79hbkyrp5Twi94dVoCUpmUUn6sT/1qpovfCvkHRY+04j8Xy Lbpg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r24si3013122edb.330.2021.10.09.02.36.10; Sat, 09 Oct 2021 02:36:34 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231853AbhJIJgt (ORCPT + 99 others); Sat, 9 Oct 2021 05:36:49 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:56698 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231555AbhJIJgr (ORCPT ); Sat, 9 Oct 2021 05:36:47 -0400 Received: from fsav119.sakura.ne.jp (fsav119.sakura.ne.jp [27.133.134.246]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 1999YksO093143; Sat, 9 Oct 2021 18:34:46 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav119.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp); Sat, 09 Oct 2021 18:34:46 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav119.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 1999YjUX093140 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 Oct 2021 18:34:45 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [PATCH] block: fix syzbot report UAF in bdev_free_inode() To: Zqiang Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk References: <20211009065951.11567-1-qiang.zhang1211@gmail.com> From: Tetsuo Handa Message-ID: Date: Sat, 9 Oct 2021 18:34:43 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211009065951.11567-1-qiang.zhang1211@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/10/09 15:59, Zqiang wrote: > The xa_insert() may be return error in __alloc_disk_node(), and the disk > object will be release, however there are two operations that will release > it, kfree(disk) and iput(disk->part0->bd_inode), the iput operations > will call call_rcu(), because the rcu callback executed is an asynchronous > actionthe, so when free disk object in rcu callback, the disk object haven > been released. solve it through a unified release action. > > Reported-by: syzbot+8281086e8a6fbfbd952a@syzkaller.appspotmail.com > Signed-off-by: Zqiang Thanks. But my patch is ready for 5.15. https://lore.kernel.org/all/e6dd13c5-8db0-4392-6e78-a42ee5d2a1c4@i-love.sakura.ne.jp/T/#u