[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240925121137.1307574-95-sashal@kernel.org>
Date: Wed, 25 Sep 2024 08:08:35 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Remington Brasga <rbrasga@....edu>,
syzbot+e38d703eeb410b17b473@...kaller.appspotmail.com,
Dave Kleikamp <dave.kleikamp@...cle.com>,
Sasha Levin <sashal@...nel.org>,
shaggy@...nel.org,
ghandatmanas@...il.com,
juntong.deng@...look.com,
osmtendev@...il.com,
peili.dev@...il.com,
eadavis@...com,
jfs-discussion@...ts.sourceforge.net
Subject: [PATCH AUTOSEL 6.6 095/139] jfs: UBSAN: shift-out-of-bounds in dbFindBits
From: Remington Brasga <rbrasga@....edu>
[ Upstream commit b0b2fc815e514221f01384f39fbfbff65d897e1c ]
Fix issue with UBSAN throwing shift-out-of-bounds warning.
Reported-by: syzbot+e38d703eeb410b17b473@...kaller.appspotmail.com
Signed-off-by: Remington Brasga <rbrasga@....edu>
Signed-off-by: Dave Kleikamp <dave.kleikamp@...cle.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/jfs/jfs_dmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.43.0
Powered by blists - more mailing lists