Re: [PATCH v2] nbd: fix uaf in nbd_open
- To: josef@toxicpanda.com, Li Lingfeng <lilingfeng@huaweicloud.com>
- Cc: linux-kernel@vger.kernel.org, hch@lst.de, linux-block@vger.kernel.org, nbd@other.debian.org, chaitanya.kulkarni@wdc.com, yukuai1@huaweicloud.com, houtao1@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com, lilingfeng3@huawei.com
- Subject: Re: [PATCH v2] nbd: fix uaf in nbd_open
- From: Jens Axboe <axboe@kernel.dk>
- Date: Tue, 07 Nov 2023 08:15:31 -0700
- Message-id: <[🔎] 169937013187.545643.6485076095455389311.b4-ty@kernel.dk>
- In-reply-to: <20231107103435.2074904-1-lilingfeng@huaweicloud.com>
- References: <20231107103435.2074904-1-lilingfeng@huaweicloud.com>
On Tue, 07 Nov 2023 18:34:35 +0800, Li Lingfeng wrote:
> Commit 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and
> blk_cleanup_disk") cleans up disk by blk_cleanup_disk() and it won't set
> disk->private_data as NULL as before. UAF may be triggered in nbd_open()
> if someone tries to open nbd device right after nbd_put() since nbd has
> been free in nbd_dev_remove().
>
> Fix this by implementing ->free_disk and free private data in it.
>
> [...]
Applied, thanks!
[1/1] nbd: fix uaf in nbd_open
commit: 327462725b0f759f093788dfbcb2f1fd132f956b
Best regards,
--
Jens Axboe
Reply to: