public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* Race in block/blk-mq-sched.c blk_mq_sched_dispatch_requests
@ 2024-01-17 20:16 Gabriel Ryan
  2024-01-17 20:17 ` Jens Axboe
  0 siblings, 1 reply; 6+ messages in thread
From: Gabriel Ryan @ 2024-01-17 20:16 UTC (permalink / raw)
  To: axboe, linux-block

We found a race in the block message queue for kernel v5.18-rc5 using
a race testing tool we are developing. We are reporting this race
because it appears to be potentially harmful. The race occurs in

block/blk-mq-sched.c:333 blk_mq_sched_dispatch_requests

    hctx->run++;

where multiple threads can schedule dispatch requests and increment
the request counter htctx->run simultaneously. This appears to lead to
undefined behavior where multiple conflicting updates to the hctx->run
 value could result in it not matching the number of requests that
have been scheduled with calls to blk_mq_sched_dispatch_requests.

Best,
Gabe

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-17 20:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 20:16 Race in block/blk-mq-sched.c blk_mq_sched_dispatch_requests Gabriel Ryan
2024-01-17 20:17 ` Jens Axboe
2024-01-17 20:22   ` Bart Van Assche
2024-01-17 20:28     ` Jens Axboe
2024-01-17 20:36       ` Gabriel Ryan
2024-01-17 20:49         ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox