blk-throtl: fix race in io dispatching
hulk inclusion category: bugfix bugzilla: 186449, https://gitee.com/openeuler/kernel/issues/I4YSPC CVE: NA -------------------------------- If io is throttled, such io will be issued by blk_throtl_dispatch_work_fn() or blk_throtl_drain(), and the io is fetched by throtl_pop_queued(). throtl_pop_queued() should be protected by 'queue_lock', as what blk_throtl_dispatch_work_fn() does. However, it's not protected in blk_throtl_drain(), which may lead to concurrent bio_list_pop(), and may end up crashing the kernel. Fix the problem by protecting throtl_pop_queued() through 'queue_lock' in blk_throtl_drain(). Signed-off-by: NYu Kuai <yukuai3@huawei.com> Reviewed-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
Showing
想要评论请 注册 或 登录