]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree
authorNihar Chaithanya <niharchaithanya@gmail.com>
Tue, 8 Oct 2024 20:21:38 +0000 (01:51 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:52 +0000 (20:03 +0100)
commit8a4311bbde702362fe7412045d06ab6767235dac
tree9c96606b67ebafbd9c87c77d35bc9dede57a7f9b
parent8ff7579554571d92e3deab168f5a7d7b146ed368
jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree

[ Upstream commit a174706ba4dad895c40b1d2277bade16dfacdcd9 ]

When the value of lp is 0 at the beginning of the for loop, it will
become negative in the next assignment and we should bail out.

Reported-by: syzbot+412dea214d8baa3f7483@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=412dea214d8baa3f7483
Tested-by: syzbot+412dea214d8baa3f7483@syzkaller.appspotmail.com
Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jfs/jfs_dmap.c