Forwarded: test
From: syzbot
Date: Thu Oct 29 2026 - 07:19:33 EST
For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.
***
Subject: test
Author: gowtham398gs@xxxxxxxxx
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index f0646fb24371..d35efa876274 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -3050,6 +3050,11 @@ static struct r1conf *setup_conf(struct mddev *mddev)
struct md_rdev *rdev;
size_t r1bio_size;
int err = -ENOMEM;
+
+ /* check if mddev->raid_disks is valid before passsing through
kzalloc */
+
+ if(mddev->raid_disks <= 0 || mddev->raid_disks > MAX_RAID_DISKS)
+ return ERR_PTR(-EINVAL);
conf = kzalloc_obj(struct r1conf);
if (!conf)