jfs: fix array-index-out-of-bounds in dbAdjTree
authorManas Ghandat <ghandatmanas@gmail.com>
Tue, 17 Oct 2023 12:03:56 +0000 (17:33 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:15 +0000 (20:14 +0000)
commit2e16a1389b5a7983b45cb2aa20b0e3f0ee364d6c
treef439c085e77d86ff55bba8f063e2ab1f1c8f7b50
parent7110650b85dd2f1cee819acd1345a9013a1a62f7
jfs: fix array-index-out-of-bounds in dbAdjTree

[ Upstream commit 74ecdda68242b174920fe7c6133a856fb7d8559b ]

Currently there is a bound check missing in the dbAdjTree while
accessing the dmt_stree. To add the required check added the bool is_ctl
which is required to determine the size as suggest in the following
commit.
https://lore.kernel.org/linux-kernel-mentees/f9475918-2186-49b8-b801-6f0f9e75f4fa@oracle.com/

Reported-by: syzbot+39ba34a099ac2e9bd3cb@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=39ba34a099ac2e9bd3cb
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