public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+4b717071f1eecb2972df@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: Re: [syzbot] UBSAN: shift-out-of-bounds in dbAllocAG
Date: Fri, 17 Apr 2026 09:20:32 -0700	[thread overview]
Message-ID: <69e25dd0.050a0220.1de265.0029.GAE@google.com> (raw)
In-Reply-To: <68f1c794.a00a0220.361615.000f.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: shift-out-of-bounds in dbAllocAG
Author: tristmd@gmail.com

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From 68c84cc03503804c418f99cf442b48de6959405b Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@talencesecurity.com>
Date: Fri, 17 Apr 2026 16:15:15 +0000
Subject: [PATCH] jfs: add upper bound check for budmin in check_dmapctl()
check_dmapctl() validates that budmin >= BUDMIN but does not check
the upper bound. A corrupted filesystem image can set budmin to a
value larger than L2MAXL2SIZE, causing UBSAN shift-out-of-bounds
when the value is used as a shift count in dbAllocAG() and
dbFindCtl().
Add an upper bound check on budmin in check_dmapctl() to reject
values exceeding L2MAXL2SIZE.
Reported-by: syzbot+4b717071f1eecb2972df@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4b717071f1eecb2972df
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
 fs/jfs/jfs_dmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index a841cf2..eb7c3ba 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -190,9 +190,9 @@ static bool check_dmapctl(struct dmapctl *dcp)
 				nleafs);
 			return false;
 		}
-	} else if (unlikely(budmin < BUDMIN)) {
-		jfs_err("dmapctl: invalid budmin %d (min %d)",
-			budmin, BUDMIN);
+	} else if (unlikely(budmin < BUDMIN || budmin > L2MAXL2SIZE)) {
+		jfs_err("dmapctl: invalid budmin %d (valid range %d-%d)",
+			budmin, BUDMIN, L2MAXL2SIZE);
 		return false;
 	}
 
-- 
2.47.3

      parent reply	other threads:[~2026-04-17 16:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17  4:35 [syzbot] [jfs?] UBSAN: shift-out-of-bounds in dbAllocAG (3) syzbot
2025-10-17  8:13 ` [PATCH] jfs: test syz test Pei Xiao
2025-10-17  8:24   ` Pei Xiao
2025-10-17 10:52   ` [syzbot] [jfs?] UBSAN: shift-out-of-bounds in dbAllocAG (3) syzbot
2025-10-17 19:25 ` Forwarded: " syzbot
2025-10-17 20:13 ` syzbot
2026-04-17 10:12 ` Forwarded: [PATCH] jfs: validate budmin from dmapctl to prevent shift-out-of-bounds syzbot
2026-04-17 16:20 ` 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=69e25dd0.050a0220.1de265.0029.GAE@google.com \
    --to=syzbot+4b717071f1eecb2972df@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