]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
jfs: Fix shift-out-of-bounds in dbDiscardAG
authorPei Li <peili.dev@gmail.com>
Tue, 25 Jun 2024 16:42:05 +0000 (09:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2024 04:05:38 +0000 (06:05 +0200)
commit234e6ea0855cdb5673d54ecaf7dc5c78f3e84630
treee05dd94d6f51905bb97c5af372e10f818bec6e87
parent9c2ac38530d1a3ee558834dfa16c85a40fd0e702
jfs: Fix shift-out-of-bounds in dbDiscardAG

[ Upstream commit 7063b80268e2593e58bee8a8d709c2f3ff93e2f2 ]

When searching for the next smaller log2 block, BLKSTOL2() returned 0,
causing shift exponent -1 to be negative.

This patch fixes the issue by exiting the loop directly when negative
shift is found.

Reported-by: syzbot+61be3359d2ee3467e7e4@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=61be3359d2ee3467e7e4
Signed-off-by: Pei Li <peili.dev@gmail.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jfs/jfs_dmap.c