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.10.14~287 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85dfc405938ff4a4436fe27a62b7727377bbaf56;p=thirdparty%2Fkernel%2Fstable.git jfs: UBSAN: shift-out-of-bounds in dbFindBits [ Upstream commit b0b2fc815e514221f01384f39fbfbff65d897e1c ] 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 Signed-off-by: Sasha Levin --- diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 0625d1c0d0649..8847e8c5d5b45 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; }