]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nbd: fix nbd device deletion
authorJosef Bacik <jbacik@fb.com>
Wed, 16 May 2018 18:51:17 +0000 (14:51 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jun 2018 23:54:01 +0000 (07:54 +0800)
commit481684cacb2cc00cbdb35d52edb4aa5d5e3bec39
treeabc7f1b9e55e1c34fa8933c181f1cc0508efd85c
parent335136d2e26e9d09a73c9bad315f9075a7a8557f
nbd: fix nbd device deletion

commit 8364da4751cf22201d74933d5e634176f44ed407 upstream.

This fixes a use after free bug, we shouldn't be doing disk->queue right
after we do del_gendisk(disk).  Save the queue and do the cleanup after
the del_gendisk.

Fixes: c6a4759ea0c9 ("nbd: add device refcounting")
cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/nbd.c