jfs: fix array-index-out-of-bounds in dbFindLeaf
authorManas Ghandat <ghandatmanas@gmail.com>
Wed, 4 Oct 2023 05:47:18 +0000 (11:17 +0530)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Wed, 4 Oct 2023 14:17:53 +0000 (09:17 -0500)
commit22cad8bc1d36547cdae0eef316c47d917ce3147c
tree3624a19b65212722d99db6b3b701b85ed63aee0a
parent64933ab7b04881c6c18b21ff206c12278341c72e
jfs: fix array-index-out-of-bounds in dbFindLeaf

Currently while searching for dmtree_t for sufficient free blocks there
is an array out of bounds while getting element in tp->dm_stree. To add
the required check for out of bound we first need to determine the type
of dmtree. Thus added an extra parameter to dbFindLeaf so that the type
of tree can be determined and the required check can be applied.

Reported-by: syzbot+aea1ad91e854d0a83e04@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=aea1ad91e854d0a83e04
Signed-off-by: Manas Ghandat <ghandatmanas@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
fs/jfs/jfs_dmap.c