Linux RAID subsystem development
 help / color / mirror / Atom feed
From: "Chen Cheng" <chencheng@fnnas.com>
To: <yukuai@fygo.io>, <nixiao@fygo.io>, <linux-raid@vger.kernel.org>
Cc: <chencheng@fnnas.com>
Subject: [PATCH v2 0/2] md/raid5: validate disk count before reshape assembly
Date: Mon, 21 Sep 2026 15:16:51 +0800	[thread overview]
Message-ID: <cover.1789974245.git.chencheng@fnnas.com> (raw)

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.

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

-- 
2.55.0

             reply	other threads:[~2026-09-21  7:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21  7:16 Chen Cheng [this message]
2026-09-21  7:16 ` [PATCH v2 1/2] md/raid5: extract min_raid_disks() Chen Cheng
2026-09-21  7:16 ` [PATCH v2 2/2] md/raid5: reject invalid reshape disks in raid5_run() Chen Cheng
2026-09-22  7:23 ` [PATCH v2 0/2] md/raid5: validate disk count before reshape assembly yu kuai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1789974245.git.chencheng@fnnas.com \
    --to=chencheng@fnnas.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=nixiao@fygo.io \
    --cc=yukuai@fygo.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox