diff options
| author | Li Lingfeng <[email protected]> | 2023-11-07 10:34:35 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2023-11-07 15:14:57 +0000 |
| commit | 327462725b0f759f093788dfbcb2f1fd132f956b (patch) | |
| tree | ad6437b4535a62a854f869c0050eea1491b2b617 /lib/memory-notifier-error-inject.c | |
| parent | Merge tag 'rtc-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni... (diff) | |
| download | kernel-327462725b0f759f093788dfbcb2f1fd132f956b.tar.gz kernel-327462725b0f759f093788dfbcb2f1fd132f956b.zip | |
nbd: fix uaf in nbd_open
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 <[email protected]>
Reviewed-by: Josef Bacik <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions
