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)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Tue, 21 Nov 2023 21:26:33 +0000 (15:26 -0600)
commit74ecdda68242b174920fe7c6133a856fb7d8559b
treecd2ffaf9e0701562cfc93f6ab43e910a09493714
parentfa5492ee89463a7590a1449358002ff7ef63529f
jfs: fix array-index-out-of-bounds in dbAdjTree

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>
fs/jfs/jfs_dmap.c