mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] md/raid5: validate disk count before reshape assembly
@ 2026-09-14 12:17 Chen Cheng
  2026-09-14 12:17 ` [PATCH v1 1/2] md/raid5: extract min_raid_disks() Chen Cheng
  2026-09-14 12:17 ` [PATCH v1 2/2] md/raid5: reject invalid reshape disks in raid5_run() Chen Cheng
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Cheng @ 2026-09-14 12:17 UTC (permalink / raw)
  To: linux-raid, yukuai, nixiao; +Cc: chencheng, linux-kernel

From: Chen Cheng <chencheng@fnnas.com>

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.

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(-)

-- 
2.55.0

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

end of thread, other threads:[~2026-09-14 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-14 12:17 [PATCH v1 0/2] md/raid5: validate disk count before reshape assembly Chen Cheng
2026-09-14 12:17 ` [PATCH v1 1/2] md/raid5: extract min_raid_disks() Chen Cheng
2026-09-14 12:17 ` [PATCH v1 2/2] md/raid5: reject invalid reshape disks in raid5_run() Chen Cheng

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

all inboxes | Powered by JetHome®