public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [gfs2?] WARNING in rgblk_free (2)
@ 2026-01-12 15:49 syzbot
  2026-01-12 19:12 ` Andrew Price
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: syzbot @ 2026-01-12 15:49 UTC (permalink / raw)
  To: agruenba, gfs2, linux-kernel, syzkaller-bugs

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
Modules linked in:
CPU: 0 UID: 0 PID: 5483 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:rgblk_free+0x136/0x750 fs/gfs2/rgrp.c:2267
Code: c0 0f 85 fe 05 00 00 45 8b 36 44 89 f7 44 89 e6 e8 cf 42 b9 fd 45 39 e6 76 2e e8 05 41 b9 fd e9 89 00 00 00 e8 fb 40 b9 fd 90 <0f> 0b 65 48 8b 05 b0 f9 78 0e 48 3b 84 24 80 00 00 00 0f 85 a0 05
RSP: 0018:ffffc90002797a80 EFLAGS: 00010293
RAX: ffffffff8407c5a6 RBX: ffff88801fce7000 RCX: ffff888000634980
RDX: 0000000000000000 RSI: 0000000000000927 RDI: 0000000025540013
RBP: ffff88801fce7000 R08: ffffffff8f824677 R09: 1ffffffff1f048ce
R10: dffffc0000000000 R11: fffffbfff1f048cf R12: 0000000000000927
R13: 0000000000000001 R14: 0000000025540013 R15: dffffc0000000000
FS:  000055556242d500(0000) GS:ffff88808d414000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000011b5f000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 gfs2_unlink_di+0x296/0x420 fs/gfs2/rgrp.c:2566
 gfs2_unlink_inode+0x11d/0x180 fs/gfs2/inode.c:1226
 gfs2_unlink+0x448/0x550 fs/gfs2/inode.c:1298
 vfs_rmdir+0x512/0x660 fs/namei.c:5236
 do_rmdir+0x27f/0x4a0 fs/namei.c:5291
 __do_sys_rmdir fs/namei.c:5315 [inline]
 __se_sys_rmdir fs/namei.c:5313 [inline]
 __x64_sys_rmdir+0x47/0x50 fs/namei.c:5313
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xec/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbfb358f7c9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc4142d868 EFLAGS: 00000246 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 00007fbfb37e5fa0 RCX: 00007fbfb358f7c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000200000000100
RBP: 00007fbfb3613f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fbfb37e5fa0 R14: 00007fbfb37e5fa0 R15: 0000000000000001
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 5+ messages in thread

* 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
  2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING in rgblk_free syzbot
  2 siblings, 1 reply; 5+ 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] 5+ messages in thread

* Re: [syzbot] [gfs2?] WARNING in rgblk_free (2)
  2026-01-12 19:12 ` Andrew Price
@ 2026-01-12 19:34   ` syzbot
  0 siblings, 0 replies; 5+ messages in thread
From: syzbot @ 2026-01-12 19:34 UTC (permalink / raw)
  To: anprice, gfs2, linux-kernel, syzkaller-bugs

Hello,

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

Reported-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com
Tested-by: syzbot+3e2c95229d1ab81a0bfd@syzkaller.appspotmail.com

Tested on:

commit:         0f61b186 Linux 6.19-rc5
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1030a99a580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3027d9a5f96d82ca
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
patch:          https://syzkaller.appspot.com/x/patch.diff?x=13a3e5fa580000

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

^ permalink raw reply	[flat|nested] 5+ 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
  2 siblings, 0 replies; 5+ 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] 5+ 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
  2 siblings, 0 replies; 5+ 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] 5+ messages in thread

end of thread, other threads:[~2026-04-17 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING in rgblk_free syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox