Skip to content

Commit a5f5e46

Browse files
ghanshyam1898kleikamp
authored andcommitted
jfs: fix shift-out-of-bounds in dbSplit
When dmt_budmin is less than zero, it causes errors in the later stages. Added a check to return an error beforehand in dbAllocCtl itself. Reported-by: syzbot+b5ca8a249162c4b9a7d0@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=b5ca8a249162c4b9a7d0 Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@gmail.com> Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
1 parent ca84a2c commit a5f5e46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/jfs/jfs_dmap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,9 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
18201820
return -EIO;
18211821
dp = (struct dmap *) mp->data;
18221822

1823+
if (dp->tree.budmin < 0)
1824+
return -EIO;
1825+
18231826
/* try to allocate the blocks.
18241827
*/
18251828
rc = dbAllocDmapLev(bmp, dp, (int) nblocks, l2nb, results);

0 commit comments

Comments
 (0)