[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <671bc7a5.050a0220.455e8.0229.GAE@google.com>
Date: Fri, 25 Oct 2024 09:30:29 -0700
From: syzbot <syzbot+9e90a1c5eedb9dc4c6cc@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [PATCH v3] jfs: UBSAN: shift-out-of-bounds in dbFindBits
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com.
***
Subject: [PATCH v3] jfs: UBSAN: shift-out-of-bounds in dbFindBits
Author: zoo868e@...il.com
The starting bit number of free bits should not be >= 32 as it is
0-indexed.Assert that the number of bits is < 32, or if it is 32, the
input word must be 0.
#syz test
Reported-by: syzbot+9e90a1c5eedb9dc4c6cc@...kaller.appspotmail.com
Signed-off-by: Matt Jan <zoo868e@...il.com>
---
Changes in v3: return the result earlier instead of assert
Changes in v2: Test if the patch resolve the issue through syzbot and
reference the reporter.
fs/jfs/jfs_dmap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 974ecf5e0d95..346f2617b744 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -3017,6 +3017,9 @@ static int dbFindBits(u32 word, int l2nb)
nb = 1 << l2nb;
assert(nb <= DBWORD);
+ if (nb == DBWORD)
+ return (!!word) << BUDMIN;
+
/* complement the word so we can use a mask (i.e. 0s represent
* free bits) and compute the mask.
*/
--
2.25.1
Powered by blists - more mailing lists