]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix use-after-free in block flush handling
authorJens Axboe <axboe@kernel.dk>
Sat, 9 Jun 2018 12:37:14 +0000 (06:37 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 Jun 2018 12:37:14 +0000 (06:37 -0600)
commit474b04e58fb7e7491e21b15fcee2887dc72bb83a
tree7b1d6db69efaf3ccb7d888d7cdfa1ccb59798178
parent1c60cb01626a85d84d43b3f8a19305a8e909a91f
block: fix use-after-free in block flush handling

A recent commit reused the original request flags for the flush
queue handling. However, for some of the kick flush cases, the
original request was already completed. This caused a use after
free, if blk-mq wasn't used.

Fixes: 8bcc4b76e82e ("block: pass failfast and driver-specific flags to flush requests")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-flush.c