Skip to content

block: Fix races in bdev - gendisk handling

Jan Kara linux-block 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 4 repliesIn review
  2. v16 patches 3 repliesSuperseded

Changes in v2 from the cover letter

* Added tested-by tags

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6genhd: Fix leaked module reference for NVME devicesblock/genhd.c+3 -01 reply
2/6genhd: Rename get_disk() to get_disk_and_module()block/genhd.c drivers/block/amiflop.c drivers/block/ataflop.c +7 more+13 -150 replies
3/6genhd: Add helper put_disk_and_module()block/blk-cgroup.c block/genhd.c fs/block_dev.c +1 more+24 -270 replies
4/6genhd: Fix use after free in __blkdev_get()fs/block_dev.c+5 -20 replies
5/6genhd: Fix BUG in blkdev_open()block/genhd.c include/linux/genhd.h+21 -10 replies
6/6blockdev: Avoid two active bdev inodes for one devicefs/block_dev.c+23 -20 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchHou TaoChristoph Hellwig
1/6R-b
2/6
3/6
4/6T-b
5/6Reported-and-analyzed-by T-b
6/6T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH 0/6 v2] block: Fix races in bdev - gendisk handling

Hello,

these patches fix races happening when devices are frequently destroyed and recreated in association of block device inode with corresponding gendisk. Generally when such race happen it results in use-after-free issues, block device page cache inconsistencies, or other problems. I have verified these patches fix use-after-free issues that could be reproduced by frequent creation and destruction of loop device. Hou Tao has verified that races reported by him in [1] related to gendisk-blkdev association were also fixed. Jens, can you please merge these patches? Thanks!

Changes since v1:
* Added tested-by tags

Honza

[1] https://www.spinics.net/lists/linux-block/msg20015.html