]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: fix use after free on module unload
authorJosef Bacik <josef@toxicpanda.com>
Fri, 28 Apr 2017 13:49:19 +0000 (09:49 -0400)
committerJens Axboe <axboe@fb.com>
Fri, 28 Apr 2017 14:04:01 +0000 (08:04 -0600)
commitbfdcdb8cbaa48b02a4a6a0acb009e4ed9aa8a97e
tree53c39316d3556a156734ef78ab5300874ff53d6a
parentefcfb6da510034d0510ccec9070cc6f6b3c2adb7
nbd: fix use after free on module unload

list_for_each_entry() isn't super safe if we're freeing the objects
while we traverse the list.  Also don't bother taking the extra
reference, the module refcounting stuff will save us from having anybody
messing with the device while we're trying to unload.

Reported-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c