[PATCH 5.15.y] ocfs2: fix shift-out-of-bounds UBSAN bug in ocfs2_verify_volume
From: 1016331059@xxxxxx
Date: Tue Mar 24 2026 - 03:05:31 EST
|
This patch is a backport to stable 5.15.y of upstream commit
7f86b2942791012ac7b4c481d1f84a58fd2fbcfc
("ocfs2: fix shift-out-of-bounds UBSAN bug in ocfs2_verify_volume()").
This patch addresses a shift-out-of-bounds error in the
ocfs2_verify_volume() function. The bug can be triggered by an invalid
s_clustersize_bits value, which causes the _expression_
1 << le32_to_cpu(di->id2.i_super.s_clustersize_bits)
to exceed the valid shift range of a 32-bit integer, leading to an
out-of-bounds shift reported by UBSAN.
Instead of performing the invalid shift while printing the error message,
log the raw s_clustersize_bits value directly.
This backport was also tested by syzbot on Linux 5.15.201
(commit 3330a8d33e086f76608bb4e80a3dc569d04a8814 in the stable 5.15.y
tree), and the reproducer did not trigger any issue.
[ Upstream commit 7f86b2942791012ac7b4c481d1f84a58fd2fbcfc ]
Link: https://lkml.kernel.org/r/ZsPvwQAXd5R/jNY+@hostname
Reported-by: syzbot <syzbot+f3fff775402751ebb471@xxxxxxxxxxxxxxxxxxxxxxxxx>
Closes: https://syzkaller.appspot.com/bug?extid=f3fff775402751ebb471
Tested-by: syzbot <syzbot+f3fff775402751ebb471@xxxxxxxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>
Link: https://syzkaller.appspot.com/bug?extid=c6104ecfe56e0fd6b616
Tested-by: syzbot <syzbot+c6104ecfe56e0fd6b616@xxxxxxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Qasim Ijaz <qasdev00@xxxxxxxxx>
Signed-off-by: Changjian Liu <driz2t@xxxxxx>
|
Attachment:
c6104ecfe56e0fd6b616.patch
Description: c6104ecfe56e0fd6b616.patch