From: syzbot <syzbot+1afe7ef2d0062e19eeb3@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: Re: [syzbot] UBSAN: array-index-out-of-bounds in dbFindLeaf
Date: Fri, 17 Apr 2026 09:19:51 -0700 [thread overview]
Message-ID: <69e25da7.050a0220.1de265.0027.GAE@google.com> (raw)
In-Reply-To: <695faa63.050a0220.1c677c.039a.GAE@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] UBSAN: array-index-out-of-bounds in dbFindLeaf
Author: tristmd@gmail.com
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From 9fdbd0cb4943449d1104e60ec721d8dbe92a56ff Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@talencesecurity.com>
Date: Fri, 17 Apr 2026 16:15:14 +0000
Subject: [PATCH] jfs: fix array-index-out-of-bounds in dbFindLeaf
dbFindLeaf() uses an off-by-one comparison when checking array
bounds: `if (x + n > max_size)` should be `>= max_size` since
array indices are 0-based and max_size is the total element count.
When x + n equals max_size, the access tp->dmt_stree[x + n] reads
one element past the end of the array.
Fix by using >= instead of > in the bounds check.
Reported-by: syzbot+1afe7ef2d0062e19eeb3@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1afe7ef2d0062e19eeb3
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
fs/jfs/jfs_dmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index a841cf2..cbdcc8d 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -3058,7 +3058,7 @@ static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl)
/* sufficient free space found. move to the next
* level (or quit if this is the last level).
*/
- if (x + n > max_size)
+ if (x + n >= max_size)
return -ENOSPC;
if (l2nb <= tp->dmt_stree[x + n])
break;
--
2.47.3
prev parent reply other threads:[~2026-04-17 16:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-08 13:00 [syzbot] [jfs?] UBSAN: array-index-out-of-bounds in dbFindLeaf (2) syzbot
2026-01-08 14:45 ` [PATCH] jfs: fix oob in dbFindLeaf Edward Adam Davis
2026-04-17 10:11 ` Forwarded: [PATCH] jfs: fix off-by-one in dbFindLeaf tree bounds check syzbot
2026-04-17 16:19 ` syzbot [this message]
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=69e25da7.050a0220.1de265.0027.GAE@google.com \
--to=syzbot+1afe7ef2d0062e19eeb3@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox