public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] gfs2: replace WARN_ON_ONCE with error message in
Date: Fri, 17 Apr 2026 03:12:36 -0700	[thread overview]
Message-ID: <69e20794.050a0220.1de265.0011.GAE@google.com> (raw)
In-Reply-To: <69651807.050a0220.eaf7.00b2.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] gfs2: replace WARN_ON_ONCE with error message in
Author: tristmd@gmail.com

From: Tristan Madani <tristan@talencesecurity.com>

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

 rgblk_free

rgblk_free() uses WARN_ON_ONCE to report when gfs2_rbm_from_block()
fails to map the starting block to a valid resource group position:

    if (WARN_ON_ONCE(gfs2_rbm_from_block(&rbm, bstart)))
        return;

On crafted GFS2 images with corrupted resource group metadata, this
WARNING fires reliably, producing a full kernel stack trace on every
mount attempt.  The function already returns early on failure, so the
error is handled -- only the WARNING itself is problematic.

Replace WARN_ON_ONCE with an fs_warn() message that logs the invalid
block number without triggering a kernel WARNING.

Reported-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3e2c95229d1ab81a0bfd
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
 fs/gfs2/rgrp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index XXXXXXX..XXXXXXX 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2265,7 +2265,10 @@ static void rgblk_free(struct gfs2_sbd *sdp, struct gfs2_rgrpd *rgd,
 	struct gfs2_bitmap *bi, *bi_prev = NULL;

 	rbm.rgd = rgd;
-	if (WARN_ON_ONCE(gfs2_rbm_from_block(&rbm, bstart)))
+	if (gfs2_rbm_from_block(&rbm, bstart)) {
+		fs_warn(sdp, "rgblk_free: block %llu outside rgrp\n",
+			(unsigned long long)bstart);
 		return;
+	}
 	while (blen--) {
 		bi = rbm_bi(&rbm);
--
2.43.0

  parent reply	other threads:[~2026-04-17 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 15:49 [syzbot] [gfs2?] WARNING in rgblk_free (2) syzbot
2026-01-12 19:12 ` Andrew Price
2026-01-12 19:34   ` syzbot
2026-04-17 10:12 ` syzbot [this message]
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING in rgblk_free syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=69e20794.050a0220.1de265.0011.GAE@google.com \
    --to=syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox