Skip to content
Commit f40139fd authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

ublk: fix race between io_uring_cmd_complete_in_task and ublk_cancel_cmd



ublk_cancel_cmd() calls io_uring_cmd_done() to complete uring_cmd, but
we may have scheduled task work via io_uring_cmd_complete_in_task() for
dispatching request, then kernel crash can be triggered.

Fix it by not trying to canceling the command if ublk block request is
started.

Fixes: 216c8f5e ("ublk: replace monitor with cancelable uring_cmd")
Reported-by: default avatarJared Holzman <jholzman@nvidia.com>
Tested-by: default avatarJared Holzman <jholzman@nvidia.com>
Closes: https://lore.kernel.org/linux-block/d2179120-171b-47ba-b664-23242981ef19@nvidia.com/


Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250425013742.1079549-3-ming.lei@redhat.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d6aa0c17
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment