]> 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 18:51:39 +0000 (19:51 +0100)
commita3d408870bc19b794646871bc4c3a5daa66f91c5
treead990c3464df83ea203fc3d5d7971e8b68fd5c92
parent9efe72eefd4c4a7ce63b3e4d667d766d2b360cb4
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