From: syzbot <syzbot+9e3014263a35700ab49b@syzkaller.appspotmail.com>
To: aadityakansal390@gmail.com
Cc: aadityakansal390@gmail.com, linux-raid@vger.kernel.org,
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] md: add max_disks bound check in older version
Date: Sun, 13 Sep 2026 16:46:36 -0700 [thread overview]
Message-ID: <6aa735dc.3aa11909.1a03b8.0004.GAE@google.com> (raw)
In-Reply-To: <20260913234627.465492-1-aadityakansal390@gmail.com>
> #syz test
"" does not look like a valid git branch or commit.
>
> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index 680b34a63cb3..f5fce41637f1 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -1693,6 +1693,12 @@ static void super_90_sync(struct mddev *mddev, struct md_rdev *rdev)
> desc_nr = rdev2->raid_disk;
> else
> desc_nr = next_spare++;
> +
> + if (desc_nr >= MD_SB_DISKS) {
> + pr_warn("md: raid_disks = %d exceeds max_disks = %d for version 0.90\n",
> + desc_nr, MD_SB_DISKS);
> + continue;
> + }
> rdev2->desc_nr = desc_nr;
> d = &sb->disks[rdev2->desc_nr];
> nr_disks++;
> @@ -1722,7 +1728,7 @@ static void super_90_sync(struct mddev *mddev, struct md_rdev *rdev)
> d->state |= (1<<MD_DISK_FAILFAST);
> }
> /* now set the "removed" and "faulty" bits on any missing devices */
> - for (i=0 ; i < mddev->raid_disks ; i++) {
> + for (i = 0; i < mddev->raid_disks && i < MD_SB_DISKS; i++) {
> mdp_disk_t *d = &sb->disks[i];
> if (d->state == 0 && d->number == 0) {
> d->number = i;
> --
> 2.55.0
>
next parent reply other threads:[~2026-09-13 23:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260913234627.465492-1-aadityakansal390@gmail.com>
2026-09-13 23:46 ` syzbot [this message]
[not found] <20260913233717.464321-1-aadityakansal390@gmail.com>
2026-09-13 23:37 ` syzbot
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=6aa735dc.3aa11909.1a03b8.0004.GAE@google.com \
--to=syzbot+9e3014263a35700ab49b@syzkaller.appspotmail.com \
--cc=aadityakansal390@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=syzkaller-bugs@googlegroups.com \
/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
all inboxes | Powered by JetHome®