A compute node panicked in submit_bio_noacct() under a vhost-blk worker
(ASUP-3910):

  BUG: kernel NULL pointer dereference, address: 000000000000019e
  RIP: 0010:submit_bio_noacct+0x12e/0x530
   vhost_blk_req_submit+0xf7/0x1c0 [vhost_blk]
   vhost_blk_req_handle+0x3b4/0x400 [vhost_blk]
   vhost_blk_handle_guest_kick+0x1a0/0x2c6 [vhost_blk]

blk_throtl_init() publishes q->td before blkcg_activate_policy()
attaches throttle data to the blkgs. The throttle check in
submit_bio_noacct() runs before bio_queue_enter(), so the queue freeze
does not cover it, and a bio in that window gets a NULL throtl_grp. In
the vmcore the bio is the first read of a dm-qcow2 device created a
moment earlier, and its blkg holds the per-disk limit being applied.
vhost-blk submits as soon as the guest kicks, which makes the window
easy to hit on VM start.

Patch 1 is the upstream fix. Patch 2 is its upstream follow-up and
must go with it: with patch 1 alone blkg_destroy_all() clears the
policy bit before blk_throtl_exit() runs, and q->td leaks on every
removal of a throttled disk. Both apply cleanly.

Build-tested only: the race needs a throttle limit set at the moment
the first bio of a fresh disk is submitted.

https://virtuozzo.atlassian.net/browse/VSTOR-152993

Han Guangjiang (1):
  ms/blk-throttle: fix access race during throttle policy activation

Yu Kuai (1):
  ms/blk-throttle: fix throtl_data leak during disk release

 block/blk-cgroup.c   |  6 ------
 block/blk-cgroup.h   |  6 ++++++
 block/blk-throttle.c | 13 ++++++-------
 block/blk-throttle.h | 18 +++++++++++-------
 4 files changed, 23 insertions(+), 20 deletions(-)

-- 
2.53.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to