Skip to content

block: fix partition use-after-free and optimization

Ming Lei linux-block 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 2 repliesIn review
  2. v24 patches 4 repliesSuperseded
  3. v14 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- add reviewed-by tag
- centralize partno check in the helper(4/4)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4block: fix use-after-free on cached last_lookup partitionblock/blk-core.c block/genhd.c block/partitions/core.c+23 -160 replies
2/4block: only define 'nr_sects_seq' in hd_part for 32bit SMPblock/genhd.c block/partitions/core.c include/linux/genhd.h+11 -20 replies
3/4block: re-organize fields of 'struct hd_part'include/linux/genhd.h+8 -70 replies
4/4block: don't hold part0's refcount in IO pathblock/blk.h block/genhd.c+8 -90 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/4R-b
2/4R-b
3/4R-b
4/4R-b

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

Read the v3 thread

Cover letter [PATCH V3 0/4] block: fix partition use-after-free and optimization

Hi,

The 1st patch fixes one use-after-free on cached last_lookup partition.

The other 3 patches optimizes partition uses in IO path.

V3:
- add reviewed-by tag
- centralize partno check in the helper(4/4)

V2:
- add comment, use part_to_disk() to retrieve disk instead of adding one field to hd_struct
- don't put part in blk_account_io_merge

Ming Lei (4):
block: fix use-after-free on cached last_lookup partition
block: only define 'nr_sects_seq' in hd_part for 32bit SMP
block: re-organize fields of 'struct hd_part'
block: don't hold part0's refcount in IO path

 block/blk-core.c        | 12 ------------
 block/blk.h             | 13 ++++++-------
 block/genhd.c           | 17 +++++++++++++----
 block/partitions/core.c | 14 ++++++++++++--
 include/linux/genhd.h   | 24 +++++++++++++++++-------
 5 files changed, 48 insertions(+), 32 deletions(-)
Cc Yufen Yu <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Hou Tao <[email protected]>
Signature · 1 line
2.25.2