]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: fix race between timeout and CPU hotplug
authorMing Lei <ming.lei@canonical.com>
Tue, 21 Apr 2015 02:00:19 +0000 (10:00 +0800)
committerJens Axboe <axboe@fb.com>
Thu, 23 Apr 2015 16:27:35 +0000 (10:27 -0600)
commit8eecdfa31043f136751f58fb515992981ec11ccc
tree90cdfbaea772655ade496e030aae8c7c0a871945
parent71c6a806b57dc2a86104c5f623d0b97d7904de18
blk-mq: fix race between timeout and CPU hotplug

Firstly during CPU hotplug, even queue is freezed, timeout
handler still may come and access hctx->tags, which may cause
use after free, so this patch deactivates timeout handler
inside CPU hotplug notifier.

Secondly, tags can be shared by more than one queues, so we
have to check if the hctx has been unmapped, otherwise
still use-after-free on tags can be triggered.

Cc: <stable@vger.kernel.org>
Reported-by: Dongsu Park <dongsu.park@profitbricks.com>
Tested-by: Dongsu Park <dongsu.park@profitbricks.com>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c