]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 16:45:43 +0000 (16:45 +0000)
commit20f9310a18e3e99fc031e036fcbed67105ae1859
treefd4d6b4e085cd3a8391eb72c0cf3583b59266ea8
parenta0649e2dd4a3595b5595a29d0064d047c2fae2fb
jfs: fix array-index-out-of-bounds in dbFindLeaf

[ Upstream commit 22cad8bc1d36547cdae0eef316c47d917ce3147c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jfs/jfs_dmap.c