kernel BUG in gfs2_withdraw

33 views
Skip to first unread message

Hui Guo

unread,
Aug 30, 2024, 10:38:37 PMAug 30
to Andreas Gruenbacher, gf...@lists.linux.dev, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hi Kernel Maintainers,
we found a crash "kernel BUG in gfs2_withdraw" (it seems a bug in
gfs2) in upstream:
This bug seems to have been triggered before and fixed, but it can
still be triggered now.

HEAD Commit: d5d547aa7b51467b15d9caa86b116f8c2507c72a(Merge tag
'random-6.11-rc6-for-linus')
console output:
https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/log0
kernel config: https://github.com/androidAppGuard/KernelBugs/blob/main/6.11.config
syz reproducer:
https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/repro.prog
C reproducer: https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/repro.cprog
the state file of fs:
https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/mount_0.gz

Best,
Hui Guo

The following context is the crash report.

gfs2: fsid=syz:syz.0: fatal: invalid metadata block - bh =
1125899906854035 (bad magic number), function = gfs2_quota_init, file
= fs/gfs2/quota.c, line = 1432
gfs2: fsid=syz:syz.0: about to withdraw this file system
------------[ cut here ]------------
kernel BUG at fs/gfs2/util.c:340!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 12970 Comm: syz.1.390 Not tainted
6.11.0-rc5-00081-gd5d547aa7b51 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:gfs2_withdraw+0xf32/0x11e0 data/linux_kernel/linux/fs/gfs2/util.c:340
Code: e6 e8 52 02 d2 fd 4d 85 e4 0f 84 5d ff ff ff e8 e4 fe d1 fd 4c
89 e7 e8 ec 3a 36 07 49 89 c4 e9 13 ff ff ff e8 cf fe d1 fd 90 <0f> 0b
e8 c7 fe d1 fd be 08 00 00 00 48 89 ef e8 2a 3a 2d fe f0 80
RSP: 0018:ffffc90017a8f6c0 EFLAGS: 00010246
RAX: 0000000000040000 RBX: ffff88805ab0c000 RCX: ffffc9000f4d1000
RDX: 0000000000040000 RSI: ffffffff83b80071 RDI: 0000000000000001
RBP: ffff88805ab0c0a8 R08: 0000000000000001 R09: ffffed1005885179
R10: 0000000000000004 R11: 0000000000000000 R12: 0000000000000004
R13: 0000000000001001 R14: ffffc90017a8f750 R15: ffff88805ab0d1f8
FS: 00007f0c2d8db640(0000) GS:ffff88802c400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc52c957a8c CR3: 00000000633d4000 CR4: 0000000000750ef0
PKRU: 80000000
Call Trace:
<TASK>
gfs2_meta_check_ii+0x65/0xa0 data/linux_kernel/linux/fs/gfs2/util.c:501
gfs2_metatype_check_i data/linux_kernel/linux/fs/gfs2/util.h:126 [inline]
gfs2_quota_init+0xfda/0x1360 data/linux_kernel/linux/fs/gfs2/quota.c:1432
gfs2_make_fs_rw+0x3a2/0x5d0 data/linux_kernel/linux/fs/gfs2/super.c:159
gfs2_fill_super+0x2887/0x2c00 data/linux_kernel/linux/fs/gfs2/ops_fstype.c:1274
get_tree_bdev+0x378/0x600 data/linux_kernel/linux/fs/super.c:1635
gfs2_get_tree+0x4e/0x280 data/linux_kernel/linux/fs/gfs2/ops_fstype.c:1329
vfs_get_tree+0x94/0x380 data/linux_kernel/linux/fs/super.c:1800
do_new_mount data/linux_kernel/linux/fs/namespace.c:3472 [inline]
path_mount+0x6b2/0x1ea0 data/linux_kernel/linux/fs/namespace.c:3799
do_mount data/linux_kernel/linux/fs/namespace.c:3812 [inline]
__do_sys_mount data/linux_kernel/linux/fs/namespace.c:4020 [inline]
__se_sys_mount data/linux_kernel/linux/fs/namespace.c:3997 [inline]
__x64_sys_mount+0x284/0x310 data/linux_kernel/linux/fs/namespace.c:3997
do_syscall_x64 data/linux_kernel/linux/arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcb/0x250 data/linux_kernel/linux/arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f0c2cb9b45e
Code: 48 c7 c0 ff ff ff ff eb aa e8 5e 20 00 00 66 2e 0f 1f 84 00 00
00 00 00 0f 1f 40 00 f3 0f 1e fa 49 89 ca b8 a5 00 00 00 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:00007f0c2d8dada8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000003b2c4 RCX: 00007f0c2cb9b45e
RDX: 000000002003b2c0 RSI: 000000002003b300 RDI: 00007f0c2d8dae00
RBP: 00007f0c2d8dae40 R08: 00007f0c2d8dae40 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000002003b2c0
R13: 000000002003b300 R14: 00007f0c2d8dae00 R15: 0000000020000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:gfs2_withdraw+0xf32/0x11e0 data/linux_kernel/linux/fs/gfs2/util.c:340
Code: e6 e8 52 02 d2 fd 4d 85 e4 0f 84 5d ff ff ff e8 e4 fe d1 fd 4c
89 e7 e8 ec 3a 36 07 49 89 c4 e9 13 ff ff ff e8 cf fe d1 fd 90 <0f> 0b
e8 c7 fe d1 fd be 08 00 00 00 48 89 ef e8 2a 3a 2d fe f0 80
RSP: 0018:ffffc90017a8f6c0 EFLAGS: 00010246
RAX: 0000000000040000 RBX: ffff88805ab0c000 RCX: ffffc9000f4d1000
RDX: 0000000000040000 RSI: ffffffff83b80071 RDI: 0000000000000001
RBP: ffff88805ab0c0a8 R08: 0000000000000001 R09: ffffed1005885179
R10: 0000000000000004 R11: 0000000000000000 R12: 0000000000000004
R13: 0000000000001001 R14: ffffc90017a8f750 R15: ffff88805ab0d1f8
FS: 00007f0c2d8db640(0000) GS:ffff88802c400000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc52c957a8c CR3: 00000000633d4000 CR4: 0000000000750ef0
PKRU: 80000000

syzbot

unread,
Sep 2, 2024, 4:54:29 AMSep 2
to agru...@redhat.com, gf...@lists.linux.dev, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 928f79a188aa Merge tag 'loongarch-fixes-6.11-2' of git://g..
git tree: upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=14987643980000
kernel config: https://syzkaller.appspot.com/x/.config?x=a0455552d0b27491
dashboard link: https://syzkaller.appspot.com/bug?extid=ed42f17ebcb58526788c
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=12d2f62b980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=109fb60b980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f1ca818b8564/disk-928f79a1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2cae3d4d58a7/vmlinux-928f79a1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d66b706213bc/bzImage-928f79a1.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/d2e2e3a9aae8/mount_0.gz

Bisection is inconclusive: the issue happens on the oldest tested release.

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=108f297b980000
final oops: https://syzkaller.appspot.com/x/report.txt?x=128f297b980000
console output: https://syzkaller.appspot.com/x/log.txt?x=148f297b980000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ed42f1...@syzkaller.appspotmail.com

gfs2: fsid=_){&.s: fatal: filesystem consistency error - inode = 1 19, function = gfs2_jdesc_check, file = fs/gfs2/super.c, line = 119
gfs2: fsid=_){&.s: G: s:SH n:2/13 f:aqob t:SH d:EX/0 a:0 v:0 r:2 m:20 p:3
gfs2: fsid=_){&.s: H: s:SH f:eEcH e:0 p:5212 [syz-executor117] init_journal+0x1881/0x2420 fs/gfs2/ops_fstype.c:806
gfs2: fsid=_){&.s: I: n:1/19 t:8 f:0x00 d:0x00000200 s:8388608 p:0
gfs2: fsid=_){&.s: about to withdraw this file system
------------[ cut here ]------------
kernel BUG at fs/gfs2/util.c:340!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 5212 Comm: syz-executor117 Not tainted 6.11.0-rc5-syzkaller-00079-g928f79a188aa #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:gfs2_withdraw+0x1459/0x1460 fs/gfs2/util.c:340
Code: ff ff 48 8b 4c 24 10 80 e1 07 80 c1 03 38 c1 0f 8c 51 fd ff ff 48 8b 7c 24 10 e8 02 2c 14 fe e9 42 fd ff ff e8 48 0f b0 fd 90 <0f> 0b 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc900033373c0 EFLAGS: 00010293
RAX: ffffffff83e37c58 RBX: 0000000000000004 RCX: ffff88807b0a0000
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000000
RBP: ffffc90003337560 R08: ffffffff83e36aae R09: 1ffff92000666e18
R10: dffffc0000000000 R11: fffff52000666e19 R12: 1ffff11005354815
R13: 1ffff92000666e8c R14: dffffc0000000000 R15: ffff888029aa4340
FS: 0000555569397380(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 000000007ae7c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
gfs2_jdesc_check+0x17b/0x2e0
check_journal_clean+0x162/0x360 fs/gfs2/util.c:69
init_journal+0x1881/0x2420 fs/gfs2/ops_fstype.c:806
init_inodes+0xdc/0x320 fs/gfs2/ops_fstype.c:864
gfs2_fill_super+0x1c18/0x2500 fs/gfs2/ops_fstype.c:1249
get_tree_bdev+0x3f7/0x570 fs/super.c:1635
gfs2_get_tree+0x54/0x220 fs/gfs2/ops_fstype.c:1329
vfs_get_tree+0x90/0x2b0 fs/super.c:1800
do_new_mount+0x2be/0xb40 fs/namespace.c:3472
do_mount fs/namespace.c:3812 [inline]
__do_sys_mount fs/namespace.c:4020 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9b18ad2b3a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffd7482ab88 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffd7482aba0 RCX: 00007f9b18ad2b3a
RDX: 00000000200124c0 RSI: 0000000020012500 RDI: 00007ffd7482aba0
RBP: 0000000000000004 R08: 00007ffd7482abe0 R09: 0000000000012613
R10: 0000000002800002 R11: 0000000000000282 R12: 0000000002800002
R13: 00007ffd7482abe0 R14: 0000000000000003 R15: 0000000001000000
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:gfs2_withdraw+0x1459/0x1460 fs/gfs2/util.c:340
Code: ff ff 48 8b 4c 24 10 80 e1 07 80 c1 03 38 c1 0f 8c 51 fd ff ff 48 8b 7c 24 10 e8 02 2c 14 fe e9 42 fd ff ff e8 48 0f b0 fd 90 <0f> 0b 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc900033373c0 EFLAGS: 00010293
RAX: ffffffff83e37c58 RBX: 0000000000000004 RCX: ffff88807b0a0000
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000000
RBP: ffffc90003337560 R08: ffffffff83e36aae R09: 1ffff92000666e18
R10: dffffc0000000000 R11: fffff52000666e19 R12: 1ffff11005354815
R13: 1ffff92000666e8c R14: dffffc0000000000 R15: ffff888029aa4340
FS: 0000555569397380(0000) GS:ffff8880b9300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000005fdeb8 CR3: 000000007ae7c000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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 syzk...@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

Glass Su

unread,
Sep 9, 2024, 4:12:09 AMSep 9
to Hui Guo, Andreas Gruenbacher, gf...@lists.linux.dev, linux-...@vger.kernel.org, syzkall...@googlegroups.com


> On Aug 31, 2024, at 10:38, Hui Guo <guohui...@gmail.com> wrote:
>
> Hi Kernel Maintainers,
> we found a crash "kernel BUG in gfs2_withdraw" (it seems a bug in
> gfs2) in upstream:
> This bug seems to have been triggered before and fixed, but it can
> still be triggered now.

IIUC, there is a new “bug”. See comment below.
>
> HEAD Commit: d5d547aa7b51467b15d9caa86b116f8c2507c72a(Merge tag
> 'random-6.11-rc6-for-linus')
> console output:
> https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/log0
> kernel config: https://github.com/androidAppGuard/KernelBugs/blob/main/6.11.config
> syz reproducer:
> https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/repro.prog
> C reproducer: https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/repro.cprog
> the state file of fs:
> https://github.com/androidAppGuard/KernelBugs/blob/main/d5d547aa7b51467b15d9caa86b116f8c2507c72a/0d1c927593a03040214498e5b44a9d7881a1def6/mount_0.gz
>
> Best,
> Hui Guo
>
> The following context is the crash report.
>
> gfs2: fsid=syz:syz.0: fatal: invalid metadata block - bh =
> 1125899906854035 (bad magic number), function = gfs2_quota_init, file
> = fs/gfs2/quota.c, line = 1432
> gfs2: fsid=syz:syz.0: about to withdraw this file system
> ------------[ cut here ]------------
> kernel BUG at fs/gfs2/util.c:340!
> Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
> CPU: 0 UID: 0 PID: 12970 Comm: syz.1.390 Not tainted
> 6.11.0-rc5-00081-gd5d547aa7b51 #1
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
> RIP: 0010:gfs2_withdraw+0xf32/0x11e0 data/linux_kernel/linux/fs/gfs2/util.c:340


The line triggers BUG_ON is:

BUG_ON(sdp->sd_args.ar_debug);

repro.cprog mounts the image with option “debug” which set sd_args.ar_debug.

memcpy((void*)0x20000000, "debug", 5);

The “debug” option should not be used in production systems. Can you silence the syzbot issue?


Su
Reply all
Reply to author
Forward
0 new messages