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)
commitf054b56c951bf1731ba7314a4c7f1cc0b2977cc9
tree90cdfbaea772655ade496e030aae8c7c0a871945
parent9283b42e46c2646dff1bec47e2dd683add7f9972
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