]> 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)
commit3a642a770aa51c18b2bf1344acedb0c9f500edbc
tree53c39316d3556a156734ef78ab5300874ff53d6a
parent7e6b1f911dee11d33ad9803eee9d26df5bf3a995
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