* Re: [syzbot] [gfs2?] WARNING in rgblk_free (2)
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 ` Forwarded: [PATCH] gfs2: replace WARN_ON_ONCE with error message in syzbot
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Andrew Price @ 2026-01-12 19:12 UTC (permalink / raw)
To: syzbot, gfs2, linux-kernel, syzkaller-bugs
On 12/01/2026 15:49, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 54e82e93ca93 Merge tag 'core_urgent_for_v6.19_rc4' of git:..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1216e5fa580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=513255d80ab78f2b
> dashboard link: https://syzkaller.appspot.com/bug?extid=3e2c95229d1ab81a0bfd
> compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11b4bc3a580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1015b922580000
>
> Downloadable assets:
> disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-54e82e93.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/f3befb5f53a4/vmlinux-54e82e93.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/92820ca1dbd8/bzImage-54e82e93.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/074df7c33445/mount_0.gz
> fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=10da39fc580000)
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
>
> gfs2: fsid=syz:syz.0: first mount done, others may mount
> gfs2: fsid=syz:syz.0: found 1 quota changes
> ------------[ cut here ]------------
> WARNING: fs/gfs2/rgrp.c:2267 at rgblk_free+0x136/0x750 fs/gfs2/rgrp.c:2267, CPU#0: syz.0.17/5483
The test is scribbling on an rindex entry's ri_data0.
#syz test
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -871,11 +871,15 @@ static int rgd_insert(struct gfs2_rgrpd *rgd)
rd_node);
parent = *newn;
- if (rgd->rd_addr < cur->rd_addr)
+ if (rgd->rd_addr < cur->rd_addr) {
+ if (rgd->rd_data0 + rgd->rd_data > cur->rd_addr)
+ return -EUCLEAN;
newn = &((*newn)->rb_left);
- else if (rgd->rd_addr > cur->rd_addr)
+ } else if (rgd->rd_addr > cur->rd_addr) {
+ if (rgd->rd_addr < cur->rd_data0)
+ return -EUCLEAN;
newn = &((*newn)->rb_right);
- else
+ } else
return -EEXIST;
}
@@ -944,7 +948,8 @@ static int read_rindex_entry(struct gfs2_inode *ip)
return 0;
}
- error = 0; /* someone else read in the rgrp; free it and ignore it */
+ if (error == -EEXIST)
+ error = 0; /* someone else read in the rgrp; free it and ignore it */
fail_glock:
gfs2_glock_put(rgd->rd_gl);
^ permalink raw reply [flat|nested] 6+ messages in thread* Forwarded: [PATCH] gfs2: replace WARN_ON_ONCE with error message in
2026-01-12 15:49 [syzbot] [gfs2?] WARNING in rgblk_free (2) syzbot
2026-01-12 19:12 ` Andrew Price
@ 2026-04-17 10:12 ` syzbot
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING in rgblk_free syzbot
2026-04-18 12:57 ` Forwarded: Re: [syzbot] WARNING in rgblk_free (2) syzbot
3 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2026-04-17 10:12 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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
^ permalink raw reply [flat|nested] 6+ messages in thread* Forwarded: Re: [syzbot] WARNING in rgblk_free
2026-01-12 15:49 [syzbot] [gfs2?] WARNING in rgblk_free (2) syzbot
2026-01-12 19:12 ` Andrew Price
2026-04-17 10:12 ` Forwarded: [PATCH] gfs2: replace WARN_ON_ONCE with error message in syzbot
@ 2026-04-17 16:21 ` syzbot
2026-04-18 12:57 ` Forwarded: Re: [syzbot] WARNING in rgblk_free (2) syzbot
3 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2026-04-17 16:21 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] WARNING in rgblk_free
Author: tristmd@gmail.com
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From 4649cf253677e3ba7f3266916dfe24fecc0e3b69 Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@talencesecurity.com>
Date: Fri, 17 Apr 2026 16:15:19 +0000
Subject: [PATCH] gfs2: replace WARN_ON_ONCE with error message in rgblk_free()
rgblk_free() uses WARN_ON_ONCE when gfs2_rbm_from_block() fails,
which triggers a kernel WARNING on corrupted filesystems. Replace
with fs_warn() to log the error without triggering a WARNING splat.
Reported-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3e2c95229d1ab81a0bfd
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 5988a16..a7c1965 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2264,8 +2264,11 @@ 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);
if (bi != bi_prev) {
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* Forwarded: Re: [syzbot] WARNING in rgblk_free (2)
2026-01-12 15:49 [syzbot] [gfs2?] WARNING in rgblk_free (2) syzbot
` (2 preceding siblings ...)
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING in rgblk_free syzbot
@ 2026-04-18 12:57 ` syzbot
3 siblings, 0 replies; 6+ messages in thread
From: syzbot @ 2026-04-18 12:57 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Re: [syzbot] WARNING in rgblk_free (2)
Author: tristmd@gmail.com
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From b5a6713d34c32c37d273e16bd59099a0a6370de9 Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@talencesecurity.com>
Date: Sat, 18 Apr 2026 12:57:17 +0000
Subject: [PATCH] gfs2: replace WARN_ON_ONCE with fs_warn in rgblk_free
rgblk_free() triggers WARN_ON_ONCE when gfs2_rbm_from_block() fails
due to a block number outside the resource group bounds. This can be
triggered by a corrupted filesystem image, causing unnecessary kernel
warnings.
Replace WARN_ON_ONCE with fs_warn() to provide a more informative
diagnostic message while avoiding the kernel warning.
Reported-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
Fixes: 5b924ae2b7b4 ("GFS2: fix rgrp end rounding problem for bsize < page size")
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 26d6c1eea5591..7707c1b1082f8 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2266,8 +2266,11 @@ 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);
if (bi != bi_prev) {
--
2.47.3
^ permalink raw reply related [flat|nested] 6+ messages in thread