[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231107150520.GA3913709@perftesting>
Date: Tue, 7 Nov 2023 10:05:20 -0500
From: Josef Bacik <josef@...icpanda.com>
To: Li Lingfeng <lilingfeng@...weicloud.com>
Cc: linux-kernel@...r.kernel.org, hch@....de,
linux-block@...r.kernel.org, nbd@...er.debian.org, axboe@...nel.dk,
chaitanya.kulkarni@....com, yukuai1@...weicloud.com,
houtao1@...wei.com, yi.zhang@...wei.com, yangerkun@...wei.com,
lilingfeng3@...wei.com
Subject: Re: [PATCH v2] nbd: fix uaf in nbd_open
On Tue, Nov 07, 2023 at 06:34:35PM +0800, Li Lingfeng wrote:
> From: Li Lingfeng <lilingfeng3@...wei.com>
>
> 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.
>
> Fixes: 4af5f2e03013 ("nbd: use blk_mq_alloc_disk and blk_cleanup_disk")
> Signed-off-by: Li Lingfeng <lilingfeng3@...wei.com>
Reviewed-by: Josef Bacik <josef@...icpanda.com>
Thanks,
Josef
Powered by blists - more mailing lists