Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac92419a authored by Remington Brasga's avatar Remington Brasga Committed by Harshit Mogalapalli
Browse files

jfs: UBSAN: shift-out-of-bounds in dbFindBits



[ Upstream commit b0b2fc815e514221f01384f39fbfbff65d897e1c ]

Fix issue with UBSAN throwing shift-out-of-bounds warning.

Reported-by: default avatar <syzbot+e38d703eeb410b17b473@syzkaller.appspotmail.com>
Signed-off-by: default avatarRemington Brasga <rbrasga@uci.edu>
Signed-off-by: default avatarDave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 830d908130d88745f0fd3ed9912cc381edf11ff1)
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
parent c9591bc1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3097,7 +3097,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;
	}