From: Remington Brasga Date: Wed, 10 Jul 2024 00:12:44 +0000 (+0000) Subject: jfs: UBSAN: shift-out-of-bounds in dbFindBits X-Git-Tag: v6.12-rc1~141^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0b2fc815e514221f01384f39fbfbff65d897e1c;p=thirdparty%2Fkernel%2Flinux.git jfs: UBSAN: shift-out-of-bounds in dbFindBits Fix issue with UBSAN throwing shift-out-of-bounds warning. Reported-by: syzbot+e38d703eeb410b17b473@syzkaller.appspotmail.com Signed-off-by: Remington Brasga Signed-off-by: Dave Kleikamp --- diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 5713994328cbc..ccdfa38d7a682 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c @@ -3022,7 +3022,7 @@ static int dbFindBits(u32 word, int l2nb) /* scan the word for nb free bits at nb alignments. */ - for (bitno = 0; mask != 0; bitno += nb, mask >>= nb) { + for (bitno = 0; mask != 0; bitno += nb, mask = (mask >> nb)) { if ((mask & word) == mask) break; }