From: syzbot <syzbot+3e16980543e238b95bd1@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] dm cache: fix divide error in too_many_discard_blocks
Date: Fri, 06 Nov 2026 11:21:58 -0800 [thread overview]
Message-ID: <6aee28d6.4bd0a7c9.1b4322.0000.GAE@google.com> (raw)
In-Reply-To: <6aedf353.8be4ead1.3b45e1.017d.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: [PATCH] dm cache: fix divide error in too_many_discard_blocks
Author: drifabdelmalekmohamedsaid@gmail.com
#syz test
Signed-off-by: Drif Abdelmalek Mohamed Said <drifabdelmalekmohamedsaid@gmail.com>
---
drivers/md/dm-cache-target.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 1a5072425c4a..408bc743a141 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -2383,6 +2383,8 @@ static int create_cache_policy(struct cache *cache, struct cache_args *ca,
static bool too_many_discard_blocks(sector_t discard_block_size,
sector_t origin_size)
{
+ if (discard_block_size > U32 / 2)
+ return false;
(void) sector_div(origin_size, discard_block_size);
return origin_size > MAX_DISCARD_BLOCKS;
--
2.47.3
next prev parent reply other threads:[~2026-11-06 19:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 15:33 [syzbot] [dm?] divide error in cache_ctr syzbot
2026-11-06 19:21 ` syzbot [this message]
2026-11-06 20:41 ` Forwarded: [PATCH] dm cache: fix divide error in too_many_discard_blocks 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=6aee28d6.4bd0a7c9.1b4322.0000.GAE@google.com \
--to=syzbot+3e16980543e238b95bd1@syzkaller.appspotmail.com \
--cc=linux-kernel@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 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.