]> 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)
commitf92c1f4bb1b3aa11b6d607a0ea36e1dae065cb47
tree90cdfbaea772655ade496e030aae8c7c0a871945
parente7cb656c5d7d21af2e07381c9dce48688eb0fd7c
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