Skip to contentSkip to conversation

ocfs2: shift-out-of-bounds UBSAN bug in ocfs2_verify_volume

syzbot [email protected] 2 participants 2 messages Mar 24 OCFS2

lore
Share & tools
lore
#0 lore raw

Hi,

Please test this patch on stable 5.15.y.

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 3330a8d33e086f76608bb4e80a3dc569d04a8814

Thanks,
Changjian Liu

From ae310006fc6e06c233b8d6780b2a2c6a16d6d708 Mon Sep 17 00:00:00 2001
From: Changjian Liu <[email protected]>
Date: Mon, 23 Mar 2026 11:39:19 +0800
Subject: [PATCH 5.15] ocfs2: fix shift-out-of-bounds UBSAN bug in
ocfs2_verify_volume()

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()").

---
 fs/ocfs2/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/super.c +2 -2
index bb174009206e..ae2ba616756d 100644
@@ -2369,8 +2369,8 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
 			     (unsigned long long)bh->b_blocknr);
 		} else if (le32_to_cpu(di->id2.i_super.s_clustersize_bits) < 12 ||
 			    le32_to_cpu(di->id2.i_super.s_clustersize_bits) > 20) {
-			mlog(ML_ERROR, "bad cluster size found: %u\n",
-			     1 << le32_to_cpu(di->id2.i_super.s_clustersize_bits));
+			mlog(ML_ERROR, "bad cluster size bit found: %u\n",
+			     le32_to_cpu(di->id2.i_super.s_clustersize_bits));
 		} else if (!le64_to_cpu(di->id2.i_super.s_root_blkno)) {
 			mlog(ML_ERROR, "bad root_blkno: 0\n");
 		} else if (!le64_to_cpu(di->id2.i_super.s_system_dir_blkno)) {
Signature · 1 line
2.43.0
syzbot Tested-by
#1 lore raw

Re: [v5.15] UBSAN: shift-out-of-bounds in ocfs2_fill_super

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Tested on:

commit:         3330a8d3 Linux 5.15.201
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=146dc1d6580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=30e28339904629ca
dashboard link: https://syzkaller.appspot.com/bug?extid=c6104ecfe56e0fd6b616
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
patch:          https://syzkaller.appspot.com/x/patch.diff?x=157f906a580000

Note: testing is done by a robot and is best-effort only.