* [syzbot] [gfs2?] WARNING in gfs2_check_blk_type (2)
@ 2024-03-05 11:03 syzbot
2026-04-17 10:12 ` Forwarded: [PATCH] gfs2: remove WARN_ON_ONCE in gfs2_check_blk_type syzbot
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING " syzbot
0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2024-03-05 11:03 UTC (permalink / raw)
To: agruenba, gfs2, linux-fsdevel, linux-kernel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 90d35da658da Linux 6.8-rc7
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=10bb48e4180000
kernel config: https://syzkaller.appspot.com/x/.config?x=119d08814b43915b
dashboard link: https://syzkaller.appspot.com/bug?extid=26e96d7e92eed8a21405
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17fcb02e180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1028a27a180000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/821deeb51f0a/disk-90d35da6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9a7d492f89d7/vmlinux-90d35da6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/78bfac3e2f5d/bzImage-90d35da6.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/a2629006a328/mount_0.gz
Bisection is inconclusive: the issue happens on the oldest tested release.
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=130748e4180000
final oops: https://syzkaller.appspot.com/x/report.txt?x=108748e4180000
console output: https://syzkaller.appspot.com/x/log.txt?x=170748e4180000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+26e96d7e92eed8a21405@syzkaller.appspotmail.com
gfs2: fsid=syz:syz.0: first mount done, others may mount
------------[ cut here ]------------
WARNING: CPU: 1 PID: 5058 at fs/gfs2/rgrp.c:2630 gfs2_check_blk_type+0x44e/0x680 fs/gfs2/rgrp.c:2630
Modules linked in:
CPU: 1 PID: 5058 Comm: syz-executor354 Not tainted 6.8.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
RIP: 0010:gfs2_check_blk_type+0x44e/0x680 fs/gfs2/rgrp.c:2630
Code: d4 01 00 00 8b 1b 89 df 44 89 f6 e8 4c 49 bd fd 4c 89 74 24 10 44 39 f3 76 23 e8 7d 47 bd fd 45 31 ed eb 70 e8 73 47 bd fd 90 <0f> 0b 90 41 bf f9 ff ff ff 48 8b 5c 24 18 e9 46 01 00 00 e8 5a 47
RSP: 0018:ffffc900040d78c0 EFLAGS: 00010293
RAX: ffffffff83d6242c RBX: ffff88802ee40028 RCX: ffff8880779e0000
RDX: 0000000000000000 RSI: 0000000000000012 RDI: 0000000000000013
RBP: ffffc900040d79d0 R08: ffffffff83d62422 R09: 1ffff1100f3b75dc
R10: dffffc0000000000 R11: ffffed100f3b75dd R12: 1ffff11005dc8006
R13: ffff88802ee40000 R14: 0000000000000012 R15: 0000000000000013
FS: 000055555631c380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000066c7e0 CR3: 000000002aba0000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
gfs2_inode_lookup+0xb05/0xc60 fs/gfs2/inode.c:178
gfs2_lookup_by_inum+0x51/0xf0 fs/gfs2/inode.c:251
gfs2_get_dentry fs/gfs2/export.c:139 [inline]
gfs2_fh_to_dentry+0x13a/0x1f0 fs/gfs2/export.c:160
exportfs_decode_fh_raw+0x152/0x5f0 fs/exportfs/expfs.c:444
exportfs_decode_fh+0x3c/0x80 fs/exportfs/expfs.c:584
do_handle_to_path fs/fhandle.c:155 [inline]
handle_to_path fs/fhandle.c:210 [inline]
do_handle_open+0x494/0x650 fs/fhandle.c:226
do_syscall_64+0xf9/0x240
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f87a993d839
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff387ac1f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000130
RAX: ffffffffffffffda RBX: 00007fff387ac3c8 RCX: 00007f87a993d839
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000000000004
RBP: 00007f87a99c3610 R08: 0000000000000000 R09: 00007fff387ac3c8
R10: 00007f87a9978bf3 R11: 0000000000000246 R12: 0000000000000001
R13: 00007fff387ac3b8 R14: 0000000000000001 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.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
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] 3+ messages in thread
* Forwarded: [PATCH] gfs2: remove WARN_ON_ONCE in gfs2_check_blk_type
2024-03-05 11:03 [syzbot] [gfs2?] WARNING in gfs2_check_blk_type (2) syzbot
@ 2026-04-17 10:12 ` syzbot
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING " syzbot
1 sibling, 0 replies; 3+ 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: remove WARN_ON_ONCE in gfs2_check_blk_type
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
gfs2_check_blk_type() calls gfs2_rbm_from_block() and wraps the error
check in WARN_ON_ONCE():
error = gfs2_rbm_from_block(&rbm, no_addr);
if (!WARN_ON_ONCE(error)) {
When the block address falls outside the resource group (which happens
with corrupted on-disk metadata), gfs2_rbm_from_block() returns an
error and the WARN_ON_ONCE fires, producing a kernel stack trace.
The error is already handled correctly by the function -- the block
type test is skipped and the error code propagates to the caller.
Only the WARNING itself is problematic.
Replace the WARN_ON_ONCE with a plain error check and map the error
to -ESTALE for the caller (gfs2_fh_to_dentry).
Reported-by: syzbot+26e96d7e92eed8a21405@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=26e96d7e92eed8a21405
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
@@ -2627,7 +2627,10 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
rbm.rgd = rgd;
error = gfs2_rbm_from_block(&rbm, no_addr);
- if (!WARN_ON_ONCE(error)) {
+ if (error) {
+ error = -ESTALE;
+ } else {
/*
* No need to take the local resource group lock here; the
* inode glock of @no_addr provides the necessary
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Forwarded: Re: [syzbot] WARNING in gfs2_check_blk_type
2024-03-05 11:03 [syzbot] [gfs2?] WARNING in gfs2_check_blk_type (2) syzbot
2026-04-17 10:12 ` Forwarded: [PATCH] gfs2: remove WARN_ON_ONCE in gfs2_check_blk_type syzbot
@ 2026-04-17 16:21 ` syzbot
1 sibling, 0 replies; 3+ 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 gfs2_check_blk_type
Author: tristmd@gmail.com
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From a57e64056f6b6fa2ede96b624b49baeb5269478b Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@talencesecurity.com>
Date: Fri, 17 Apr 2026 16:15:20 +0000
Subject: [PATCH] gfs2: remove WARN_ON_ONCE in gfs2_check_blk_type()
gfs2_check_blk_type() wraps gfs2_rbm_from_block() in
!WARN_ON_ONCE(), triggering a kernel WARNING on corrupted
filesystems. Replace with a plain error check and map the
error to -ESTALE for the caller.
Reported-by: syzbot+26e96d7e92eed8a21405@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=26e96d7e92eed8a21405
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
fs/gfs2/rgrp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 5988a16..da94c25 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -2625,7 +2625,9 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
rbm.rgd = rgd;
error = gfs2_rbm_from_block(&rbm, no_addr);
- if (!WARN_ON_ONCE(error)) {
+ if (error) {
+ error = -ESTALE;
+ } else {
/*
* No need to take the local resource group lock here; the
* inode glock of @no_addr provides the necessary
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-17 16:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-05 11:03 [syzbot] [gfs2?] WARNING in gfs2_check_blk_type (2) syzbot
2026-04-17 10:12 ` Forwarded: [PATCH] gfs2: remove WARN_ON_ONCE in gfs2_check_blk_type syzbot
2026-04-17 16:21 ` Forwarded: Re: [syzbot] WARNING " syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox