Skip to content

Fix a race condition triggered by submit_bio()

Bart Van Assche linux-block 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Use the full syzbot ID in patch 2/2 instead of abbreviating it.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2block: Verify whether blk_queue_enter() is used when necessaryblock/blk-cgroup.c block/blk-core.c include/linux/blk-cgroup.h +1 more+33 -00 replies
2/2block: Fix a race condition in submit_bio()block/blk-core.c+12 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] Fix a race condition triggered by submit_bio()

Hi Jens,

One of the consequences of the switch to blk-mq is that generic_make_request() calls, a function called by submit_bio(), must be protected by a blk_queue_enter() / blk_queue_exit() pair to avoid that the block-cgroup functions called by generic_make_request() trigger a race condition. This patch series makes the kernel report a warning if that race condition is hit and also adds the necessary protection in submit_bio(). Please consider these patches for kernel v5.4.

Thanks,

Bart.

Changes compared to v1:
- Use the full syzbot ID in patch 2/2 instead of abbreviating it.

Bart Van Assche (2):
block: Verify whether blk_queue_enter() is used when necessary
block: Fix a race condition in submit_bio()

 block/blk-cgroup.c         |  2 ++
 block/blk-core.c           | 34 +++++++++++++++++++++++++++++++++-
 include/linux/blk-cgroup.h |  2 ++
 include/linux/blkdev.h     |  8 ++++++++
 4 files changed, 45 insertions(+), 1 deletion(-)
Signature · 1 line
2.22.0.709.g102302147b-goog