block/loop: fix use after free
authorShaohua Li <shli@fb.com>
Fri, 1 Sep 2017 18:15:17 +0000 (11:15 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 1 Sep 2017 19:57:33 +0000 (13:57 -0600)
commit92d773324b7edbd36bf0c28c1e0157763aeccc92
tree333db14ef4338ba1daa5063535730c9c3ea3b0d9
parent12cd3a2fe3ba6d1a2cf007e4e8dcfbe66d3d0a28
block/loop: fix use after free

lo_rw_aio->call_read_iter->
1       aops->direct_IO
2       iov_iter_revert
lo_rw_aio_complete could happen between 1 and 2, the bio and bvec could
be freed before 2, which accesses bvec.

Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c
drivers/block/loop.h