All of lore.kernel.org
 help / color / mirror / Atom feed
* + ocfs2-fix-shift-out-of-bounds-ubsan-bug-in-ocfs2_verify_volume.patch added to mm-nonmm-unstable branch
@ 2024-08-20 23:40 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2024-08-20 23:40 UTC (permalink / raw)
  To: mm-commits, syzbot+f3fff775402751ebb471, piaojun, mark,
	junxiao.bi, joseph.qi, jlbec, ghe, gechangwei, qasdev00, akpm


The patch titled
     Subject: ocfs2: fix shift-out-of-bounds UBSAN bug in ocfs2_verify_volume()
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     ocfs2-fix-shift-out-of-bounds-ubsan-bug-in-ocfs2_verify_volume.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/ocfs2-fix-shift-out-of-bounds-ubsan-bug-in-ocfs2_verify_volume.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: qasdev <qasdev00@gmail.com>
Subject: ocfs2: fix shift-out-of-bounds UBSAN bug in ocfs2_verify_volume()
Date: Tue, 20 Aug 2024 02:22:09 +0100

This patch addresses a shift-out-of-bounds error in the
ocfs2_verify_volume() function, identified by UBSAN.  The bug was
triggered by an invalid s_clustersize_bits value (e.g., 1548), which
caused the expression "1 <<
le32_to_cpu(di->id2.i_super.s_clustersize_bits)" to exceed the limits of a
32-bit integer, leading to an out-of-bounds shift.

Link: https://lkml.kernel.org/r/ZsPvwQAXd5R/jNY+@hostname
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Reported-by: syzbot <syzbot+f3fff775402751ebb471@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=f3fff775402751ebb471
Tested-by: syzbot <syzbot+f3fff775402751ebb471@syzkaller.appspotmail.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Jun Piao <piaojun@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/ocfs2/super.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/ocfs2/super.c~ocfs2-fix-shift-out-of-bounds-ubsan-bug-in-ocfs2_verify_volume
+++ a/fs/ocfs2/super.c
@@ -2357,8 +2357,8 @@ static int ocfs2_verify_volume(struct oc
 			     (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)) {
_

Patches currently in -mm which might be from qasdev00@gmail.com are

ocfs2-fix-shift-out-of-bounds-ubsan-bug-in-ocfs2_verify_volume.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-20 23:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 23:40 + ocfs2-fix-shift-out-of-bounds-ubsan-bug-in-ocfs2_verify_volume.patch added to mm-nonmm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.