From: syzbot <syzbot+75f49ec552cc74d9d69b@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Forwarded: test bug for patch
Date: Wed, 28 Oct 2026 07:06:50 -0700 [thread overview]
Message-ID: <6ae2017a.5136369a.6f73.0000.GAE@google.com> (raw)
In-Reply-To: <6a8cdbd6.dbb3a75c.7844.0013.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: test bug for patch
Author: gowtham398gs@gmail.com
#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..88038d535727 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -3050,6 +3050,16 @@ static struct r1conf *setup_conf(struct mddev *mddev)
struct md_rdev *rdev;
size_t r1bio_size;
int err = -ENOMEM;
+ size_t calculated_size;
+
+ /* prevent baseline integer wrap-around anomalies first*/
+ /* Safely calculate size; overflows automatically saturate to SIZE_MAX */
+
+ calculated_size = size_add(sizeof(struct r1conf),
+ size_mul(mddev->raid_disks, sizeof(struct r1bio)));
+
+ if (mddev->raid_disks <= 0 || calculated_size >= KMALLOC_MAX_SIZE)
+ return ERR_PTR(-EINVAL);
conf = kzalloc_obj(struct r1conf);
if (!conf)
next prev parent reply other threads:[~2026-10-28 14:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 0:03 [syzbot] [mm?] WARNING in setup_conf syzbot
2026-08-25 1:22 ` Andrew Morton
2026-09-22 14:08 ` syzbot
2026-09-22 18:37 ` Andrew Morton
2026-10-28 14:06 ` syzbot [this message]
2026-10-29 11:19 ` Forwarded: test syzbot
2026-10-29 14:07 ` syzbot
2026-10-29 18:06 ` syzbot
2026-10-30 3:09 ` Forwarded: test the patch syzbot
2026-10-30 3:17 ` Forwarded: [PATCH] md/raid1: reject out-of-range raid_disks in setup_conf() 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=6ae2017a.5136369a.6f73.0000.GAE@google.com \
--to=syzbot+75f49ec552cc74d9d69b@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.