Skip to content

md/raid5: validate disk count before reshape assembly

Chen Cheng linux-raid 2 versions – Applied

Status from this message: Applied to md-7.4

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyApplied
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Added Link

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2md/raid5: extract min_raid_disks()drivers/md/raid5.c+11 -100 replies
2/2md/raid5: reject invalid reshape disks in raid5_run()drivers/md/raid5.c+7 -00 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] md/raid5: validate disk count before reshape assembly

From: Chen Cheng <[email protected]>

The previous patch rejects raid4/5 arrays with too few disks in setup_conf(). During reshape assembly, raid5_run() still divides by the data-disk count before that check, so a crafted superblock can hit division by zero.

Extract min_raid_disks() and reject invalid reshape geometries in raid5_run() first.

v1 -> v2:
- Added Link

Chen Cheng (2):
md/raid5: extract min_raid_disks()
md/raid5: reject invalid reshape disks in raid5_run()

 drivers/md/raid5.c | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)
Signature · 1 line
2.55.0