]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix use-after-free bug in blk throttle code
authorJens Axboe <jaxboe@fusionio.com>
Sat, 23 Oct 2010 18:40:26 +0000 (20:40 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sat, 23 Oct 2010 18:40:26 +0000 (20:40 +0200)
commitec48d777e3b6e95f798613a2245334bf1f17bc77
tree2e3bc1c5e3c98078b970483cd49a49d7c1ae0dcf
parent1b0b8571563a92610d502a27646acaa7ad718fe1
block: fix use-after-free bug in blk throttle code

blk_throtl_exit() frees the throttle data hanging off the queue
in blk_cleanup_queue(), but blk_put_queue() will indirectly
dereference this data when calling blk_sync_queue() which in
turns calls throtl_shutdown_timer_wq().

Fix this by moving the freeing of the throttle data to when
the queue is truly being released, and post the call to
blk_sync_queue().

Reported-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
block/blk-core.c
block/blk-sysfs.c