]> 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>
Fri, 2 May 2025 05:44:23 +0000 (07:44 +0200)
commit4de2c04c3acd5b84f50b0d2f8f09e9b2f42374b9
tree976399371b4e9f1085ba08ac6728cd1fb398327a
parent500f00c80637e93cebf967eb4f7fa6ed00197c38
jfs: Fix shift-out-of-bounds in dbDiscardAG

commit 7063b80268e2593e58bee8a8d709c2f3ff93e2f2 upstream.

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: Zhi Yang <Zhi.Yang@windriver.com>
Signed-off-by: He Zhe <zhe.he@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jfs/jfs_dmap.c