From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Pei Xiao <xiaopei01@kylinos.cn>
Cc: "Jörn Engel" <joern@barelysecure.org>,
syzbot <syzbot+b320a4d5f65a61dbbf89@syzkaller.appspotmail.com>,
joern@lazybastard.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, richard@nod.at,
syzkaller-bugs@googlegroups.com, vigneshr@ti.com
Subject: Re: [syzbot] [mtd?] divide error in block2mtd_setup2
Date: Mon, 10 Aug 2026 14:40:28 +0200 [thread overview]
Message-ID: <87se4mqhc3.fsf@bootlin.com> (raw)
In-Reply-To: <29397db9-7db4-4969-bb0e-5bb71f0c0303@kylinos.cn> (Pei Xiao's message of "Mon, 10 Aug 2026 17:17:50 +0800")
Hi Pei,
>> Best guess would be this:
>>
>> if ((long)size % erase_size) {
>>
>> Someone passing an erase_size of 0 would indeed trigger an exception.
>> Fix would be something like this:
>>
>> - if ((long)size % erase_size) {
>> + if (!erase_size || (long)size % erase_size) {
>>
>> I haven't touched the code is nearly two decades. If somebody else
>> feels like sending a patch and gathering all the glory, please be my
>> guest!
> Thank you for your contribution. I have sent this patch, but I forgot to
> add the Suggested-by: tag
You are invited to send a v2 with the said tag :)
Thanks,
Miquèl
WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Pei Xiao <xiaopei01@kylinos.cn>
Cc: "Jörn Engel" <joern@barelysecure.org>,
syzbot <syzbot+b320a4d5f65a61dbbf89@syzkaller.appspotmail.com>,
joern@lazybastard.org, linux-kernel@vger.kernel.org,
linux-mtd@lists.infradead.org, richard@nod.at,
syzkaller-bugs@googlegroups.com, vigneshr@ti.com
Subject: Re: [syzbot] [mtd?] divide error in block2mtd_setup2
Date: Mon, 10 Aug 2026 14:40:28 +0200 [thread overview]
Message-ID: <87se4mqhc3.fsf@bootlin.com> (raw)
In-Reply-To: <29397db9-7db4-4969-bb0e-5bb71f0c0303@kylinos.cn> (Pei Xiao's message of "Mon, 10 Aug 2026 17:17:50 +0800")
Hi Pei,
>> Best guess would be this:
>>
>> if ((long)size % erase_size) {
>>
>> Someone passing an erase_size of 0 would indeed trigger an exception.
>> Fix would be something like this:
>>
>> - if ((long)size % erase_size) {
>> + if (!erase_size || (long)size % erase_size) {
>>
>> I haven't touched the code is nearly two decades. If somebody else
>> feels like sending a patch and gathering all the glory, please be my
>> guest!
> Thank you for your contribution. I have sent this patch, but I forgot to
> add the Suggested-by: tag
You are invited to send a v2 with the said tag :)
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2026-08-10 12:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 0:34 [syzbot] [mtd?] divide error in block2mtd_setup2 syzbot
2026-08-10 0:34 ` syzbot
2026-08-10 2:03 ` Jörn Engel
2026-08-10 2:03 ` Jörn Engel
2026-08-10 9:17 ` Pei Xiao
2026-08-10 9:17 ` Pei Xiao
2026-08-10 12:40 ` Miquel Raynal [this message]
2026-08-10 12:40 ` Miquel Raynal
2026-08-11 3:02 ` Pei Xiao
2026-08-11 3:02 ` Pei Xiao
2026-08-10 16:27 ` Jörn Engel
2026-08-10 16:27 ` Jörn Engel
2026-08-11 1:21 ` Pei Xiao
2026-08-11 1:21 ` Pei Xiao
2026-08-10 9:12 ` [PATCH] mtd: block2mtd: Fix divide error when erase_size is zero Pei Xiao
2026-08-10 9:12 ` Pei Xiao
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=87se4mqhc3.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=joern@barelysecure.org \
--cc=joern@lazybastard.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=syzbot+b320a4d5f65a61dbbf89@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=vigneshr@ti.com \
--cc=xiaopei01@kylinos.cn \
/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.