2023-12-11 11:58:36

by syzbot

[permalink] [raw]
Subject: [syzbot] [gfs2] WARNING in vfs_utimes

Hello,

syzbot found the following issue on:

HEAD commit: aed8aee11130 Merge tag 'pmdomain-v6.6-rc1' of git://git.ke..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10ec0a28680000
kernel config: https://syzkaller.appspot.com/x/.config?x=df91a3034fe3f122
dashboard link: https://syzkaller.appspot.com/bug?extid=0c64a8706d587f73409e
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/310bcfc234f7/disk-aed8aee1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9ca036d3eeb2/vmlinux-aed8aee1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1e0032b9919c/bzImage-aed8aee1.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]

------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x1, magic = 0xffff8880371ddef0, owner = 0xffff88801d773b80, curr 0xffff888023728000, list empty
WARNING: CPU: 0 PID: 13147 at kernel/locking/rwsem.c:1370 __up_write kernel/locking/rwsem.c:1369 [inline]
WARNING: CPU: 0 PID: 13147 at kernel/locking/rwsem.c:1370 up_write+0x4f4/0x580 kernel/locking/rwsem.c:1626
Modules linked in:
CPU: 0 PID: 13147 Comm: syz-executor.1 Not tainted 6.6.0-rc1-syzkaller-00072-gaed8aee11130 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
RIP: 0010:__up_write kernel/locking/rwsem.c:1369 [inline]
RIP: 0010:up_write+0x4f4/0x580 kernel/locking/rwsem.c:1626
Code: 48 c7 c7 a0 98 0a 8b 48 c7 c6 e0 9a 0a 8b 48 8b 54 24 28 48 8b 4c 24 18 4d 89 e0 4c 8b 4c 24 30 53 e8 b0 12 e8 ff 48 83 c4 08 <0f> 0b e9 75 fd ff ff 48 c7 c1 10 9b 9a 8e 80 e1 07 80 c1 03 38 c1
RSP: 0018:ffffc9001520fbe0 EFLAGS: 00010292
RAX: 144e8f9151b91a00 RBX: ffffffff8b0a9980 RCX: ffff888023728000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: ffffc9001520fcb0 R08: ffffffff81542432 R09: 1ffff92002a41ee8
R10: dffffc0000000000 R11: fffff52002a41ee9 R12: ffff88801d773b80
R13: ffff8880371ddef0 R14: 1ffff92002a41f84 R15: dffffc0000000000
FS: 00007fadafbfe6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f527c5b8000 CR3: 000000001c7cb000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
inode_unlock include/linux/fs.h:807 [inline]
vfs_utimes+0x4c2/0x760 fs/utimes.c:68
do_utimes_path fs/utimes.c:99 [inline]
do_utimes fs/utimes.c:145 [inline]
__do_sys_utime fs/utimes.c:226 [inline]
__se_sys_utime+0x1e1/0x2e0 fs/utimes.c:215
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fadb847cae9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fadafbfe0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000084
RAX: ffffffffffffffda RBX: 00007fadb859c050 RCX: 00007fadb847cae9
RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000020000080
RBP: 00007fadb84c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fadb859c050 R15: 00007ffca2821ba8
</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 [email protected].

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 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


2023-12-13 06:36:36

by lee bruce

[permalink] [raw]
Subject: Re: [syzbot] [gfs2] WARNING in vfs_utimes

Hello, I reproduced this bug with repro.c and repro.txt since it
relatively large please see
https://gist.github.com/xrivendell7/b3b804bbf6d8c9930b2ba22e2dfaa6e6

Since this bug in the dashboard
https://syzkaller.appspot.com/bug?extid=0c64a8706d587f73409e use
kernel commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=aed8aee11130a954356200afa3f1b8753e8a9482
kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=df91a3034fe3f122

my repro.c use the seem config and it crash report like below, and
it’s almost can make sure it the same as bug reported by syzobt.

TITLE: WARNING in vfs_utimes
CORRUPTED: false ()
MAINTAINERS (TO): [[email protected]]
MAINTAINERS (CC): [[email protected] [email protected]
[email protected]]
------------[ cut here ]------------
DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) &&
!rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): y
WARNING: CPU: 2 PID: 12763 at kernel/locking/rwsem.c:1370 __up_write
kernel/locking/rwsem.c:1369 [inline]
WARNING: CPU: 2 PID: 12763 at kernel/locking/rwsem.c:1370
up_write+0x4f4/0x580 kernel/locking/rwsem.c:1626
Modules linked in:
CPU: 2 PID: 12763 Comm: c90 Not tainted 6.6.0-rc1-00072-gaed8aee11130-dirty #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:__up_write kernel/locking/rwsem.c:1369 [inline]
RIP: 0010:up_write+0x4f4/0x580 kernel/locking/rwsem.c:1626
Code: 48 c7 c7 20 99 4a 8b 48 c7 c6 60 9b 4a 8b 48 8b 54 24 28 48 8b
4c 24 18 4d 89 e0 4c 8b 4c 24 31
RSP: 0018:ffffc9000af5fbe0 EFLAGS: 00010292
RAX: d361770a4cb50c00 RBX: ffffffff8b4a9a00 RCX: 0000000000000000
RDX: ffff8880298fbcc0 RSI: ffff8880298fbcc0 RDI: 0000000000000000
RBP: ffffc9000af5fcb0 R08: ffffffff8155ef6f R09: 1ffff1101732516a
R10: dffffc0000000000 R11: ffffed101732516b R12: 0000000000000000
R13: ffff88807c966d68 R14: 1ffff920015ebf84 R15: dffffc0000000000
FS: 00007fc89df2d6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc89df2e000 CR3: 000000014aab9000 CR4: 0000000000750ee0
PKRU: 55555554
Call Trace:
<TASK>
inode_unlock include/linux/fs.h:807 [inline]
vfs_utimes+0x4dc/0x790 fs/utimes.c:68
do_utimes_path fs/utimes.c:99 [inline]
do_utimes fs/utimes.c:145 [inline]
__do_sys_utime fs/utimes.c:226 [inline]
__se_sys_utime+0x1f2/0x2f0 fs/utimes.c:215
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x43deb9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 1c 00 00 90 48 89 f8 48
89 f7 48 89 d6 48 89 ca 4d 89 c8
RSP: 002b:00007fc89df2d208 EFLAGS: 00000246 ORIG_RAX: 0000000000000084
RAX: ffffffffffffffda RBX: 00007fc89df2d6c0 RCX: 000000000043deb9
RDX: 0031656c69662f2e RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007fc89df2d220 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffb0
R13: 0000000000000016 R14: 00007fffd3267590 R15: 00007fffd3267678
</TASK>
TITLE: kernel panic: kernel: panic_on_warn set ...
CORRUPTED: false ()
MAINTAINERS (TO): [[email protected]]
MAINTAINERS (CC): [[email protected] [email protected]
[email protected]]
Modules linked in:
CPU: 2 PID: 12763 Comm: c90 Not tainted 6.6.0-rc1-00072-gaed8aee11130-dirty #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:__up_write kernel/locking/rwsem.c:1369 [inline]
RIP: 0010:up_write+0x4f4/0x580 kernel/locking/rwsem.c:1626
Code: 48 c7 c7 20 99 4a 8b 48 c7 c6 60 9b 4a 8b 48 8b 54 24 28 48 8b
4c 24 18 4d 89 e0 4c 8b 4c 24 31
RSP: 0018:ffffc9000af5fbe0 EFLAGS: 00010292
RAX: d361770a4cb50c00 RBX: ffffffff8b4a9a00 RCX: 0000000000000000
RDX: ffff8880298fbcc0 RSI: ffff8880298fbcc0 RDI: 0000000000000000
RBP: ffffc9000af5fcb0 R08: ffffffff8155ef6f R09: 1ffff1101732516a
R10: dffffc0000000000 R11: ffffed101732516b R12: 0000000000000000
R13: ffff88807c966d68 R14: 1ffff920015ebf84 R15: dffffc0000000000
FS: 00007fc89df2d6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc89df2e000 CR3: 000000014aab9000 CR4: 0000000000750ee0
PKRU: 55555554
Call Trace:
<TASK>
inode_unlock include/linux/fs.h:807 [inline]
vfs_utimes+0x4dc/0x790 fs/utimes.c:68
do_utimes_path fs/utimes.c:99 [inline]
do_utimes fs/utimes.c:145 [inline]
__do_sys_utime fs/utimes.c:226 [inline]
__se_sys_utime+0x1f2/0x2f0 fs/utimes.c:215
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x43deb9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 1c 00 00 90 48 89 f8 48
89 f7 48 89 d6 48 89 ca 4d 89 c8
RSP: 002b:00007fc89df2d208 EFLAGS: 00000246 ORIG_RAX: 0000000000000084
RAX: ffffffffffffffda RBX: 00007fc89df2d6c0 RCX: 000000000043deb9
RDX: 0031656c69662f2e RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007fc89df2d220 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffb0
R13: 0000000000000016 R14: 00007fffd3267590 R15: 00007fffd3267678
</TASK>
Kernel panic - not syncing: kernel: panic_on_warn set ...
CPU: 2 PID: 12763 Comm: c90 Not tainted 6.6.0-rc1-00072-gaed8aee11130-dirty #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1f4/0x2f0 lib/dump_stack.c:106
panic+0x31e/0x7a0 kernel/panic.c:340
__warn+0x32e/0x4c0
__report_bug lib/bug.c:199 [inline]
report_bug+0x2ca/0x520 lib/bug.c:219
handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:237
exc_invalid_op+0x1a/0x50 arch/x86/kernel/traps.c:258
asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:568
RIP: 0010:__up_write kernel/locking/rwsem.c:1369 [inline]
RIP: 0010:up_write+0x4f4/0x580 kernel/locking/rwsem.c:1626
Code: 48 c7 c7 20 99 4a 8b 48 c7 c6 60 9b 4a 8b 48 8b 54 24 28 48 8b
4c 24 18 4d 89 e0 4c 8b 4c 24 31
RSP: 0018:ffffc9000af5fbe0 EFLAGS: 00010292
RAX: d361770a4cb50c00 RBX: ffffffff8b4a9a00 RCX: 0000000000000000
RDX: ffff8880298fbcc0 RSI: ffff8880298fbcc0 RDI: 0000000000000000
RBP: ffffc9000af5fcb0 R08: ffffffff8155ef6f R09: 1ffff1101732516a
R10: dffffc0000000000 R11: ffffed101732516b R12: 0000000000000000
R13: ffff88807c966d68 R14: 1ffff920015ebf84 R15: dffffc0000000000
inode_unlock include/linux/fs.h:807 [inline]
vfs_utimes+0x4dc/0x790 fs/utimes.c:68
do_utimes_path fs/utimes.c:99 [inline]
do_utimes fs/utimes.c:145 [inline]
__do_sys_utime fs/utimes.c:226 [inline]
__se_sys_utime+0x1f2/0x2f0 fs/utimes.c:215
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x43deb9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 1c 00 00 90 48 89 f8 48
89 f7 48 89 d6 48 89 ca 4d 89 c8
RSP: 002b:00007fc89df2d208 EFLAGS: 00000246 ORIG_RAX: 0000000000000084
RAX: ffffffffffffffda RBX: 00007fc89df2d6c0 RCX: 000000000043deb9
RDX: 0031656c69662f2e RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007fc89df2d220 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffb0
R13: 0000000000000016 R14: 00007fffd3267590 R15: 00007fffd3267678
</TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..

However, the repro.c can also crash the lastest kernel HEAD commit:
88035e5694a86a7167d490bb95e9df97a9bb162b use the same configuation.
It report below the same of the bug reported by syzbot:
https://syzkaller.appspot.com/bug?extid=e14d6cd6ec241f507ba7.

TITLE: WARNING in __folio_mark_dirty
CORRUPTED: false ()
MAINTAINERS (TO): [[email protected]
[email protected] [email protected] [email protected]]
MAINTAINERS (CC): [[email protected]]
------------[ cut here ]------------
WARNING: CPU: 3 PID: 8118 at include/linux/backing-dev.h:255
folio_account_dirtied mm/page-writeback.c:2618 [inline]
WARNING: CPU: 3 PID: 8118 at include/linux/backing-dev.h:255
__folio_mark_dirty+0x936/0x1120 mm/page-writeback.c:2669
Modules linked in:
CPU: 3 PID: 8118 Comm: c90 Not tainted 6.7.0-rc5-00042-g88035e5694a8 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:inode_to_wb include/linux/backing-dev.h:252 [inline]
RIP: 0010:folio_account_dirtied mm/page-writeback.c:2618 [inline]
RIP: 0010:__folio_mark_dirty+0x936/0x1120 mm/page-writeback.c:2669
Code: f8 ff ff e8 5c 72 c8 ff 0f 0b e9 c9 f8 ff ff 31 ff e8 4e 72 c8
ff 4c 89 f7 48 8b 74 24 20 e8 bf
RSP: 0018:ffffc900142afa00 EFLAGS: 00010093
RAX: ffffffff81c92f96 RBX: 0000000000000000 RCX: ffff8880250f1e80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88801b12c2f8 R08: ffffffff81c92ab5 R09: 1ffff1100362585f
R10: dffffc0000000000 R11: ffffed1003625860 R12: 0000000000000001
R13: ffff88801b12c180 R14: ffffea000518f8c0 R15: 1ffff1100362585f
FS: 00000000023563c0(0000) GS:ffff88823bd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff0aff8f78 CR3: 000000001d875000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
<TASK>
mark_buffer_dirty+0x2ab/0x520 fs/buffer.c:1200
gfs2_unpin+0x142/0xad0 fs/gfs2/lops.c:111
buf_lo_after_commit+0x157/0x1b0 fs/gfs2/lops.c:745
lops_after_commit fs/gfs2/lops.h:51 [inline]
gfs2_log_flush+0x1f45/0x26a0 fs/gfs2/log.c:1115
gfs2_kill_sb+0x60/0x340 fs/gfs2/ops_fstype.c:1786
deactivate_locked_super+0xc8/0x140 fs/super.c:484
cleanup_mnt+0x444/0x4e0 fs/namespace.c:1256
task_work_run+0x257/0x310 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296
do_syscall_64+0x50/0x110 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x43f117
Code: 09 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66
2e 0f 1f 84 00 00 00 00 00 0f 18
RSP: 002b:00007fff0aff9728 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007fff0affaa68 RCX: 000000000043f117
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007fff0aff97d0
RBP: 00007fff0affa810 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000001
R13: 00007fff0affaa58 R14: 0000000000000001 R15: 0000000000000001
</TASK>
TITLE: kernel panic: kernel: panic_on_warn set ...
CORRUPTED: false ()
MAINTAINERS (TO): [[email protected]
[email protected] [email protected] [email protected]]
MAINTAINERS (CC): [[email protected]]
Modules linked in:
CPU: 3 PID: 8118 Comm: c90 Not tainted 6.7.0-rc5-00042-g88035e5694a8 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:inode_to_wb include/linux/backing-dev.h:252 [inline]
RIP: 0010:folio_account_dirtied mm/page-writeback.c:2618 [inline]
RIP: 0010:__folio_mark_dirty+0x936/0x1120 mm/page-writeback.c:2669
Code: f8 ff ff e8 5c 72 c8 ff 0f 0b e9 c9 f8 ff ff 31 ff e8 4e 72 c8
ff 4c 89 f7 48 8b 74 24 20 e8 bf
RSP: 0018:ffffc900142afa00 EFLAGS: 00010093
RAX: ffffffff81c92f96 RBX: 0000000000000000 RCX: ffff8880250f1e80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88801b12c2f8 R08: ffffffff81c92ab5 R09: 1ffff1100362585f
R10: dffffc0000000000 R11: ffffed1003625860 R12: 0000000000000001
R13: ffff88801b12c180 R14: ffffea000518f8c0 R15: 1ffff1100362585f
FS: 00000000023563c0(0000) GS:ffff88823bd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff0aff8f78 CR3: 000000001d875000 CR4: 0000000000750ef0
PKRU: 55555554
Call Trace:
<TASK>
mark_buffer_dirty+0x2ab/0x520 fs/buffer.c:1200
gfs2_unpin+0x142/0xad0 fs/gfs2/lops.c:111
buf_lo_after_commit+0x157/0x1b0 fs/gfs2/lops.c:745
lops_after_commit fs/gfs2/lops.h:51 [inline]
gfs2_log_flush+0x1f45/0x26a0 fs/gfs2/log.c:1115
gfs2_kill_sb+0x60/0x340 fs/gfs2/ops_fstype.c:1786
deactivate_locked_super+0xc8/0x140 fs/super.c:484
cleanup_mnt+0x444/0x4e0 fs/namespace.c:1256
task_work_run+0x257/0x310 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296
do_syscall_64+0x50/0x110 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x43f117
Code: 09 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66
2e 0f 1f 84 00 00 00 00 00 0f 18
RSP: 002b:00007fff0aff9728 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007fff0affaa68 RCX: 000000000043f117
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007fff0aff97d0
RBP: 00007fff0affa810 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000001
R13: 00007fff0affaa58 R14: 0000000000000001 R15: 0000000000000001
</TASK>
Kernel panic - not syncing: kernel: panic_on_warn set ...
CPU: 3 PID: 8118 Comm: c90 Not tainted 6.7.0-rc5-00042-g88035e5694a8 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1f4/0x2f0 lib/dump_stack.c:106
panic+0x35a/0x880 kernel/panic.c:344
__warn+0x32e/0x4c0
__report_bug lib/bug.c:199 [inline]
report_bug+0x2ca/0x520 lib/bug.c:219
handle_bug+0x3d/0x70 arch/x86/kernel/traps.c:237
exc_invalid_op+0x1a/0x50 arch/x86/kernel/traps.c:258
asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:568
RIP: 0010:inode_to_wb include/linux/backing-dev.h:252 [inline]
RIP: 0010:folio_account_dirtied mm/page-writeback.c:2618 [inline]
RIP: 0010:__folio_mark_dirty+0x936/0x1120 mm/page-writeback.c:2669
Code: f8 ff ff e8 5c 72 c8 ff 0f 0b e9 c9 f8 ff ff 31 ff e8 4e 72 c8
ff 4c 89 f7 48 8b 74 24 20 e8 bf
RSP: 0018:ffffc900142afa00 EFLAGS: 00010093
RAX: ffffffff81c92f96 RBX: 0000000000000000 RCX: ffff8880250f1e80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff88801b12c2f8 R08: ffffffff81c92ab5 R09: 1ffff1100362585f
R10: dffffc0000000000 R11: ffffed1003625860 R12: 0000000000000001
R13: ffff88801b12c180 R14: ffffea000518f8c0 R15: 1ffff1100362585f
mark_buffer_dirty+0x2ab/0x520 fs/buffer.c:1200
gfs2_unpin+0x142/0xad0 fs/gfs2/lops.c:111
buf_lo_after_commit+0x157/0x1b0 fs/gfs2/lops.c:745
lops_after_commit fs/gfs2/lops.h:51 [inline]
gfs2_log_flush+0x1f45/0x26a0 fs/gfs2/log.c:1115
gfs2_kill_sb+0x60/0x340 fs/gfs2/ops_fstype.c:1786
deactivate_locked_super+0xc8/0x140 fs/super.c:484
cleanup_mnt+0x444/0x4e0 fs/namespace.c:1256
task_work_run+0x257/0x310 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop+0xde/0x100 kernel/entry/common.c:171
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:296
do_syscall_64+0x50/0x110 arch/x86/entry/common.c:89
entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x43f117
Code: 09 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66
2e 0f 1f 84 00 00 00 00 00 0f 18
RSP: 002b:00007fff0aff9728 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007fff0affaa68 RCX: 000000000043f117
RDX: 0000000000000000 RSI: 000000000000000a RDI: 00007fff0aff97d0
RBP: 00007fff0affa810 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000206 R12: 0000000000000001
R13: 00007fff0affaa58 R14: 0000000000000001 R15: 0000000000000001
</TASK>


I hope someone figure out and hope it helps.

Best regards
xingwei Lee

2023-12-13 10:38:44

by Christian Brauner

[permalink] [raw]
Subject: Re: [syzbot] [gfs2] WARNING in vfs_utimes

On Wed, Dec 13, 2023 at 02:35:58PM +0800, xingwei lee wrote:
> Hello, I reproduced this bug with repro.c and repro.txt since it
> relatively large please see
> https://gist.github.com/xrivendell7/b3b804bbf6d8c9930b2ba22e2dfaa6e6
>
> Since this bug in the dashboard
> https://syzkaller.appspot.com/bug?extid=0c64a8706d587f73409e use
> kernel commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=aed8aee11130a954356200afa3f1b8753e8a9482
> kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=df91a3034fe3f122
>
> my repro.c use the seem config and it crash report like below, and
> it’s almost can make sure it the same as bug reported by syzobt.

Uh, can you reproduce this on mainline?
I so far fail to even with your repro.

2023-12-13 10:52:25

by lee bruce

[permalink] [raw]
Subject: Re: [syzbot] [gfs2] WARNING in vfs_utimes

> On Wed, Dec 13, 2023 at 02:35:58PM +0800, xingwei lee wrote:
> > Hello, I reproduced this bug with repro.c and repro.txt since it
> > relatively large please see
> > https://gist.github.com/xrivendell7/b3b804bbf6d8c9930b2ba22e2dfaa6e6
> >
> > Since this bug in the dashboard
> > https://syzkaller.appspot.com/bug?extid=0c64a8706d587f73409e use
> > kernel commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=aed8aee11130a954356200afa3f1b8753e8a9482
> > kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=df91a3034fe3f122
> >
> > my repro.c use the seem config and it crash report like below, and
> > it’s almost can make sure it the same as bug reported by syzobt.
>
> Uh, can you reproduce this on mainline?
> I so far fail to even with your repro.
Hi
I can still trigger my repro.c in the last mainline at HEAD: 88035e5694a8.
As I say before the crash titled is WARNING in __folio_mark_dirty not
WARNING in __folio_mark_dirty
look this crash scene:

root@syzkaller:~# uname -a
Linux syzkaller 6.7.0-rc5-00042-g88035e5694a8 #3 SMP PREEMPT_DYNAMIC
Wed Dec 13 12:47:36 CST 2023 x86_64 GNU/Linux
root@syzkaller:~# ./c90
Setting up swapspace version 1, size = 122.1 MiB (127995904 bytes)
no label, UUID=fc291aa6-a2a5-45b4-a290-1a2e1b9725f9
[ 92.326728][ T8104] Adding 124996k swap on ./swap-file. Priority:0
extents:1 across:124996k
[ 92.476988][ T8133] loop0: detected capacity change from 0 to 32768
[ 92.480453][ T8133] gfs2: fsid=syz:syz: Trying to join cluster
"lock_nolock", "syz:syz"
[ 92.480867][ T8133] gfs2: fsid=syz:syz: Now mounting FS (format 1802)...
[ 92.484105][ T8133] gfs2: fsid=syz:syz.0: journal 0 mapped with 14
extents in 0ms
[ 92.485628][ T4549] gfs2: fsid=syz:syz.0: jid=0, already locked for use
[ 92.485963][ T4549] gfs2: fsid=syz:syz.0: jid=0: Looking at journal...
[ 92.497655][ T4549] gfs2: fsid=syz:syz.0: jid=0: Journal head
lookup took 11ms
[ 92.498197][ T4549] gfs2: fsid=syz:syz.0: jid=0: Done
[ 92.498521][ T8133] gfs2: fsid=syz:syz.0: first mount done, others may mount
[ 92.546508][ T8107] ------------[ cut here ]------------
[ 92.546835][ T8107] WARNING: CPU: 2 PID: 8107 at
include/linux/backing-dev.h:255 __folio_mark_dirty+0x936/0x1120
[ 92.547304][ T8107] Modules linked in:
[ 92.547483][ T8107] CPU: 2 PID: 8107 Comm: c90 Not tainted
6.7.0-rc5-00042-g88035e5694a8 #3
[ 92.547848][ T8107] Hardware name: QEMU Standard PC (i440FX + PIIX,
1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[ 92.548297][ T8107] RIP: 0010:__folio_mark_dirty+0x936/0x1120
[ 92.548558][ T8107] Code: f8 ff ff e8 5c 72 c8 ff 0f 0b e9 c9 f8 ff
ff 31 ff e8 4e 72 c8 ff 4c 89 f7 48 8b 74 24 20 e8 b1 15 2f 00 eb 9d
e8 3a 72 c8 ff <0f> 0b e9 27 fb ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f
8c dc f8 ff
[ 92.549390][ T8107] RSP: 0018:ffffc9001389fa00 EFLAGS: 00010093
[ 92.549660][ T8107] RAX: ffffffff81c92f96 RBX: 0000000000000000
RCX: ffff888153fe9e80
[ 92.550009][ T8107] RDX: 0000000000000000 RSI: 0000000000000000
RDI: 0000000000000000
[ 92.550357][ T8107] RBP: ffff888148d91fb8 R08: ffffffff81c92ab5
R09: 1ffff110291b23f7
[ 92.550704][ T8107] R10: dffffc0000000000 R11: ffffed10291b23f8
R12: 0000000000000001
[ 92.551053][ T8107] R13: ffff888148d91e40 R14: ffffea00052ec2c0
R15: 1ffff110291b23f7
[ 92.551400][ T8107] FS: 0000000001cbb3c0(0000)
GS:ffff8880b9900000(0000) knlGS:0000000000000000
[ 92.551790][ T8107] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 92.552089][ T8107] CR2: 0000000001cc4738 CR3: 0000000154470000
CR4: 0000000000750ef0
[ 92.552452][ T8107] PKRU: 55555554
[ 92.552621][ T8107] Call Trace:
[ 92.552778][ T8107] <TASK>
[ 92.552919][ T8107] ? __warn+0x16a/0x4c0
[ 92.553125][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.553376][ T8107] ? report_bug+0x2ca/0x520
[ 92.553603][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.553854][ T8107] ? handle_bug+0x3d/0x70
[ 92.554062][ T8107] ? exc_invalid_op+0x1a/0x50
[ 92.554285][ T8107] ? asm_exc_invalid_op+0x1a/0x20
[ 92.554532][ T8107] ? __folio_mark_dirty+0x455/0x1120
[ 92.554778][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.555027][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.555279][ T8107] mark_buffer_dirty+0x2ab/0x520
[ 92.555520][ T8107] gfs2_unpin+0x142/0xad0
[ 92.555732][ T8107] ? log_pull_tail+0x87/0x390
[ 92.555956][ T8107] buf_lo_after_commit+0x157/0x1b0
[ 92.556199][ T8107] ? buf_lo_before_commit+0xf0/0xf0
[ 92.556443][ T8107] gfs2_log_flush+0x1f45/0x26a0
[ 92.556671][ T8107] ? print_irqtrace_events+0x220/0x220
[ 92.556938][ T8107] ? gfs2_ail_empty_tr+0x320/0x320
[ 92.557178][ T8107] ? rcu_force_quiescent_state+0x230/0x230
[ 92.557453][ T8107] ? radix_tree_delete_item+0x2fd/0x420
[ 92.557714][ T8107] gfs2_kill_sb+0x60/0x340
[ 92.557924][ T8107] ? shrinker_free+0x2d8/0x3e0
[ 92.558150][ T8107] deactivate_locked_super+0xc8/0x140
[ 92.558407][ T8107] cleanup_mnt+0x444/0x4e0
[ 92.558618][ T8107] ? _raw_spin_unlock_irq+0x23/0x50
[ 92.558868][ T8107] task_work_run+0x257/0x310
[ 92.559091][ T8107] ? task_work_cancel+0x2c0/0x2c0
[ 92.559330][ T8107] ? exit_to_user_mode_loop+0x39/0x100
[ 92.559588][ T8107] exit_to_user_mode_loop+0xde/0x100
[ 92.559837][ T8107] exit_to_user_mode_prepare+0xb1/0x140
[ 92.560098][ T8107] syscall_exit_to_user_mode+0x64/0x280
[ 92.560367][ T8107] do_syscall_64+0x50/0x110
[ 92.560582][ T8107] entry_SYSCALL_64_after_hwframe+0x63/0x6b
[ 92.560859][ T8107] RIP: 0033:0x43f117
[ 92.561047][ T8107] Code: 09 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84
00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6
00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8
64 89 02 b8
[ 92.561908][ T8107] RSP: 002b:00007fff2befd8e8 EFLAGS: 00000206
ORIG_RAX: 00000000000000a6
[ 92.562290][ T8107] RAX: 0000000000000000 RBX: 00007fff2befec28
RCX: 000000000043f117
[ 92.562650][ T8107] RDX: 0000000000000000 RSI: 000000000000000a
RDI: 00007fff2befd990
[ 92.563010][ T8107] RBP: 00007fff2befe9d0 R08: 0000000000000000
R09: 0000000000000000
[ 92.563367][ T8107] R10: 00000000ffffffff R11: 0000000000000206
R12: 0000000000000001
[ 92.563719][ T8107] R13: 00007fff2befec18 R14: 0000000000000001
R15: 0000000000000001
[ 92.564078][ T8107] </TASK>
[ 92.564220][ T8107] Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 92.564542][ T8107] CPU: 2 PID: 8107 Comm: c90 Not tainted
6.7.0-rc5-00042-g88035e5694a8 #3
[ 92.564919][ T8107] Hardware name: QEMU Standard PC (i440FX + PIIX,
1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[ 92.565374][ T8107] Call Trace:
[ 92.565528][ T8107] <TASK>
[ 92.565665][ T8107] dump_stack_lvl+0x1f4/0x2f0
[ 92.565885][ T8107] ? nf_tcp_handle_invalid+0x680/0x680
[ 92.566135][ T8107] ? panic+0x880/0x880
[ 92.566331][ T8107] ? vscnprintf+0x64/0x90
[ 92.566532][ T8107] panic+0x35a/0x880
[ 92.566717][ T8107] ? __warn+0x179/0x4c0
[ 92.566911][ T8107] ? __memcpy_flushcache+0x2d0/0x2d0
[ 92.567163][ T8107] __warn+0x32e/0x4c0
[ 92.567349][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.567592][ T8107] report_bug+0x2ca/0x520
[ 92.567793][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.568037][ T8107] handle_bug+0x3d/0x70
[ 92.568231][ T8107] exc_invalid_op+0x1a/0x50
[ 92.568440][ T8107] asm_exc_invalid_op+0x1a/0x20
[ 92.568664][ T8107] RIP: 0010:__folio_mark_dirty+0x936/0x1120
[ 92.568930][ T8107] Code: f8 ff ff e8 5c 72 c8 ff 0f 0b e9 c9 f8 ff
ff 31 ff e8 4e 72 c8 ff 4c 89 f7 48 8b 74 24 20 e8 b1 15 2f 00 eb 9d
e8 3a 72 c8 ff <0f> 0b e9 27 fb ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f
8c dc f8 ff
[ 92.569771][ T8107] RSP: 0018:ffffc9001389fa00 EFLAGS: 00010093
[ 92.570047][ T8107] RAX: ffffffff81c92f96 RBX: 0000000000000000
RCX: ffff888153fe9e80
[ 92.570406][ T8107] RDX: 0000000000000000 RSI: 0000000000000000
RDI: 0000000000000000
[ 92.570764][ T8107] RBP: ffff888148d91fb8 R08: ffffffff81c92ab5
R09: 1ffff110291b23f7
[ 92.571122][ T8107] R10: dffffc0000000000 R11: ffffed10291b23f8
R12: 0000000000000001
[ 92.571481][ T8107] R13: ffff888148d91e40 R14: ffffea00052ec2c0
R15: 1ffff110291b23f7
[ 92.571844][ T8107] ? __folio_mark_dirty+0x455/0x1120
[ 92.572091][ T8107] ? __folio_mark_dirty+0x936/0x1120
[ 92.572346][ T8107] mark_buffer_dirty+0x2ab/0x520
[ 92.572581][ T8107] gfs2_unpin+0x142/0xad0
[ 92.572785][ T8107] ? log_pull_tail+0x87/0x390
[ 92.573010][ T8107] buf_lo_after_commit+0x157/0x1b0
[ 92.573249][ T8107] ? buf_lo_before_commit+0xf0/0xf0
[ 92.573493][ T8107] gfs2_log_flush+0x1f45/0x26a0
[ 92.573721][ T8107] ? print_irqtrace_events+0x220/0x220
[ 92.573982][ T8107] ? gfs2_ail_empty_tr+0x320/0x320
[ 92.574222][ T8107] ? rcu_force_quiescent_state+0x230/0x230
[ 92.574494][ T8107] ? radix_tree_delete_item+0x2fd/0x420
[ 92.574754][ T8107] gfs2_kill_sb+0x60/0x340
[ 92.574965][ T8107] ? shrinker_free+0x2d8/0x3e0
[ 92.575191][ T8107] deactivate_locked_super+0xc8/0x140
[ 92.575444][ T8107] cleanup_mnt+0x444/0x4e0
[ 92.575654][ T8107] ? _raw_spin_unlock_irq+0x23/0x50
[ 92.575898][ T8107] task_work_run+0x257/0x310
[ 92.576118][ T8107] ? task_work_cancel+0x2c0/0x2c0
[ 92.576363][ T8107] ? exit_to_user_mode_loop+0x39/0x100
[ 92.576620][ T8107] exit_to_user_mode_loop+0xde/0x100
[ 92.576871][ T8107] exit_to_user_mode_prepare+0xb1/0x140
[ 92.577129][ T8107] syscall_exit_to_user_mode+0x64/0x280
[ 92.577390][ T8107] do_syscall_64+0x50/0x110
[ 92.577604][ T8107] entry_SYSCALL_64_after_hwframe+0x63/0x6b
[ 92.577879][ T8107] RIP: 0033:0x43f117
[ 92.578062][ T8107] Code: 09 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84
00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6
00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 b0 ff ff ff f7 d8
64 89 02 b8
[ 92.578920][ T8107] RSP: 002b:00007fff2befd8e8 EFLAGS: 00000206
ORIG_RAX: 00000000000000a6
[ 92.579299][ T8107] RAX: 0000000000000000 RBX: 00007fff2befec28
RCX: 000000000043f117
[ 92.579655][ T8107] RDX: 0000000000000000 RSI: 000000000000000a
RDI: 00007fff2befd990
[ 92.580014][ T8107] RBP: 00007fff2befe9d0 R08: 0000000000000000
R09: 0000000000000000
[ 92.580375][ T8107] R10: 00000000ffffffff R11: 0000000000000206
R12: 0000000000000001
[ 92.580732][ T8107] R13: 00007fff2befec18 R14: 0000000000000001
R15: 0000000000000001
[ 92.581097][ T8107] </TASK>
[ 92.581318][ T8107] Kernel Offset: disabled
[ 92.581592][ T8107] Rebooting in 86400 seconds..

Please check again.

Thanks!
Best regards
xingwei Lee.

2023-12-13 15:27:51

by Andreas Gruenbacher

[permalink] [raw]
Subject: Re: [syzbot] [gfs2] WARNING in vfs_utimes

On Wed, Dec 13, 2023 at 11:45 AM Christian Brauner <[email protected]> wrote:
> On Wed, Dec 13, 2023 at 02:35:58PM +0800, xingwei lee wrote:
> > Hello, I reproduced this bug with repro.c and repro.txt since it
> > relatively large please see
> > https://gist.github.com/xrivendell7/b3b804bbf6d8c9930b2ba22e2dfaa6e6
> >
> > Since this bug in the dashboard
> > https://syzkaller.appspot.com/bug?extid=0c64a8706d587f73409e use
> > kernel commit: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?id=aed8aee11130a954356200afa3f1b8753e8a9482
> > kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=df91a3034fe3f122
> >
> > my repro.c use the seem config and it crash report like below, and
> > it’s almost can make sure it the same as bug reported by syzobt.
>
> Uh, can you reproduce this on mainline?
> I so far fail to even with your repro.

I regularly run afoul of not running "losetup -f" before these
reproducers and so they end up doing nothing; see here:

https://lore.kernel.org/all/CAHc6FU7b-BaBXrMR3UqbZGF3a_y=20TKkCNde1GvqbmN2-h1xw@mail.gmail.com/

Andreas