[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240601030028.22250-1-aha310510@gmail.com>
Date: Sat, 1 Jun 2024 12:00:28 +0900
From: Jeongjun Park <aha310510@...il.com>
To: syzbot+13e8cd4926977f8337b6@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [jfs?] UBSAN: shift-out-of-bounds in extAlloc (2)
please test shift-out-of-bounds in extAlloc
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
---
fs/jfs/jfs_extent.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c
index 63d21822d309..3d1273d35b13 100644
--- a/fs/jfs/jfs_extent.c
+++ b/fs/jfs/jfs_extent.c
@@ -316,6 +316,9 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
if (bmp->db_maxfreebud == -1)
return -ENOSPC;
+ if (bmp->db_maxfreebud >= sizeof(s64) * 8 - 1)
+ return -EINVAL;
+
max = (s64) 1 << bmp->db_maxfreebud;
if (*nblocks >= max && *nblocks > nbperpage)
nb = nblks = (max > nbperpage) ? max : nbperpage;
--
2.34.1
Powered by blists - more mailing lists