syzbot


BUG: sleeping function called from invalid context in gfs2_glock_wait

Status: upstream: reported C repro on 2025/03/23 20:36
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+e95313becc22e8a22e22@syzkaller.appspotmail.com
First crash: 29d, last: 6d22h
Bug presence (1)
Date Name Commit Repro Result
2025/03/25 upstream (ToT) 2df0c02dab82 C [report] INFO: task hung in block_invalidate_folio
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: sleeping function called from invalid context in gfs2_glock_wait gfs2 C error error 5 701d 825d 0/28 auto-obsoleted due to no activity on 2024/02/25 10:52
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/04/14 23:55 23m retest repro linux-5.15.y report log

Sample crash report:
gfs2: fsid=syz:syz.0: first mount done, others may mount
attempt to access beyond end of device
loop0: rw=1, want=16778992, limit=32768
gfs2: fsid=syz:syz.0: Error 10 writing to journal, jid=0
gfs2: fsid=syz:syz.0: fatal: I/O error(s)
gfs2: fsid=syz:syz.0: about to withdraw this file system
BUG: sleeping function called from invalid context at fs/gfs2/glock.c:1281
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4162, name: syz-executor272
5 locks held by syz-executor272/4162:
 #0: ffff88802405a460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
 #1: ffff888070a28150 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff888070a28150 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3529 [inline]
 #1: ffff888070a28150 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: path_openat+0x824/0x2f20 fs/namei.c:3739
 #2: ffff88802405a650 (sb_internal#2){.+.+}-{0:0}, at: gfs2_trans_begin+0x6d/0xe0 fs/gfs2/trans.c:118
 #3: ffff88802c7650a8 (&sdp->sd_log_flush_lock){++++}-{3:3}, at: gfs2_log_flush+0xe4/0x2680 fs/gfs2/log.c:1035
 #4: ffff88802c764ed0 (&sdp->sd_log_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
 #4: ffff88802c764ed0 (&sdp->sd_log_lock){+.+.}-{2:2}, at: gfs2_log_lock fs/gfs2/log.h:32 [inline]
 #4: ffff88802c764ed0 (&sdp->sd_log_lock){+.+.}-{2:2}, at: gfs2_flush_revokes+0x4f/0x80 fs/gfs2/log.c:806
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 4162 Comm: syz-executor272 Not tainted 5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 ___might_sleep+0x547/0x6a0 kernel/sched/core.c:9638
 gfs2_glock_wait+0x54/0x1c0 fs/gfs2/glock.c:1281
 gfs2_glock_nq_init fs/gfs2/glock.h:246 [inline]
 gfs2_freeze_lock+0x5a/0xc0 fs/gfs2/util.c:107
 signal_our_withdraw fs/gfs2/util.c:160 [inline]
 gfs2_withdraw+0x5be/0x14e0 fs/gfs2/util.c:343
 gfs2_ail1_empty+0x811/0x8a0 fs/gfs2/log.c:369
 gfs2_flush_revokes+0x5a/0x80 fs/gfs2/log.c:807
 revoke_lo_before_commit+0x28/0x5f0 fs/gfs2/lops.c:872
 lops_before_commit fs/gfs2/lops.h:40 [inline]
 gfs2_log_flush+0xce5/0x2680 fs/gfs2/log.c:1094
 gfs2_trans_end+0x39b/0x560 fs/gfs2/trans.c:158
 alloc_dinode+0x41d/0x580 fs/gfs2/inode.c:419
 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
 atomic_open fs/namei.c:3325 [inline]
 lookup_open fs/namei.c:3433 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0xf75/0x2f20 fs/namei.c:3739
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f4f4d38a639
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:00007ffd262cf6a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffd262cf878 RCX: 00007f4f4d38a639
RDX: 0000000000000042 RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007f4f4d435610 R08: 0000000000037f96 R09: 00007ffd262cf878
R10: 00000000000001ff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd262cf868 R14: 0000000000000001 R15: 0000000000000001
 </TASK>

=============================
[ BUG: Invalid wait context ]
5.15.179-syzkaller #0 Tainted: G        W        
-----------------------------
syz-executor272/4162 is trying to lock:
ffff88801e550088 (&wq->mutex){+.+.}-{3:3}, at: flush_workqueue+0x19c/0x1610 kernel/workqueue.c:2833
other info that might help us debug this:
context-{4:4}
5 locks held by syz-executor272/4162:
 #0: ffff88802405a460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
 #1: ffff888070a28150 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff888070a28150 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3529 [inline]
 #1: ffff888070a28150 (&type->i_mutex_dir_key#6){+.+.}-{3:3}, at: path_openat+0x824/0x2f20 fs/namei.c:3739
 #2: ffff88802405a650 (sb_internal#2){.+.+}-{0:0}, at: gfs2_trans_begin+0x6d/0xe0 fs/gfs2/trans.c:118
 #3: ffff88802c7650a8 (&sdp->sd_log_flush_lock){++++}-{3:3}, at: gfs2_log_flush+0xe4/0x2680 fs/gfs2/log.c:1035
 #4: ffff88802c764ed0 (&sdp->sd_log_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:363 [inline]
 #4: ffff88802c764ed0 (&sdp->sd_log_lock){+.+.}-{2:2}, at: gfs2_log_lock fs/gfs2/log.h:32 [inline]
 #4: ffff88802c764ed0 (&sdp->sd_log_lock){+.+.}-{2:2}, at: gfs2_flush_revokes+0x4f/0x80 fs/gfs2/log.c:806
stack backtrace:
CPU: 1 PID: 4162 Comm: syz-executor272 Tainted: G        W         5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_lock_invalid_wait_context kernel/locking/lockdep.c:4664 [inline]
 check_wait_context kernel/locking/lockdep.c:4725 [inline]
 __lock_acquire+0x14f5/0x1ff0 kernel/locking/lockdep.c:4962
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 flush_workqueue+0x19c/0x1610 kernel/workqueue.c:2833
 gfs2_make_fs_ro+0xd1/0x5f0 fs/gfs2/super.c:529
 signal_our_withdraw fs/gfs2/util.c:166 [inline]
 gfs2_withdraw+0x5fb/0x14e0 fs/gfs2/util.c:343
 gfs2_ail1_empty+0x811/0x8a0 fs/gfs2/log.c:369
 gfs2_flush_revokes+0x5a/0x80 fs/gfs2/log.c:807
 revoke_lo_before_commit+0x28/0x5f0 fs/gfs2/lops.c:872
 lops_before_commit fs/gfs2/lops.h:40 [inline]
 gfs2_log_flush+0xce5/0x2680 fs/gfs2/log.c:1094
 gfs2_trans_end+0x39b/0x560 fs/gfs2/trans.c:158
 alloc_dinode+0x41d/0x580 fs/gfs2/inode.c:419
 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
 atomic_open fs/namei.c:3325 [inline]
 lookup_open fs/namei.c:3433 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0xf75/0x2f20 fs/namei.c:3739
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f4f4d38a639
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:00007ffd262cf6a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffd262cf878 RCX: 00007f4f4d38a639
RDX: 0000000000000042 RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007f4f4d435610 R08: 0000000000037f96 R09: 00007ffd262cf878
R10: 00000000000001ff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd262cf868 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
BUG: sleeping function called from invalid context at kernel/sched/completion.c:101
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 4162, name: syz-executor272
INFO: lockdep is turned off.
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 4162 Comm: syz-executor272 Tainted: G        W         5.15.179-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 ___might_sleep+0x547/0x6a0 kernel/sched/core.c:9638
 __wait_for_common kernel/sched/completion.c:101 [inline]
 wait_for_common kernel/sched/completion.c:117 [inline]
 wait_for_completion+0x19/0x60 kernel/sched/completion.c:138
 kthread_stop+0x178/0x580 kernel/kthread.c:666
 gfs2_make_fs_ro+0x14d/0x5f0 fs/gfs2/super.c:533
 signal_our_withdraw fs/gfs2/util.c:166 [inline]
 gfs2_withdraw+0x5fb/0x14e0 fs/gfs2/util.c:343
 gfs2_ail1_empty+0x811/0x8a0 fs/gfs2/log.c:369
 gfs2_flush_revokes+0x5a/0x80 fs/gfs2/log.c:807
 revoke_lo_before_commit+0x28/0x5f0 fs/gfs2/lops.c:872
 lops_before_commit fs/gfs2/lops.h:40 [inline]
 gfs2_log_flush+0xce5/0x2680 fs/gfs2/log.c:1094
 gfs2_trans_end+0x39b/0x560 fs/gfs2/trans.c:158
 alloc_dinode+0x41d/0x580 fs/gfs2/inode.c:419
 gfs2_create_inode+0xfc4/0x1ba0 fs/gfs2/inode.c:720
 gfs2_atomic_open+0xe1/0x220 fs/gfs2/inode.c:1295
 atomic_open fs/namei.c:3325 [inline]
 lookup_open fs/namei.c:3433 [inline]
 open_last_lookups fs/namei.c:3532 [inline]
 path_openat+0xf75/0x2f20 fs/namei.c:3739
 do_filp_open+0x21c/0x460 fs/namei.c:3769
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1280
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f4f4d38a639
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:00007ffd262cf6a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffd262cf878 RCX: 00007f4f4d38a639
RDX: 0000000000000042 RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007f4f4d435610 R08: 0000000000037f96 R09: 00007ffd262cf878
R10: 00000000000001ff R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd262cf868 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
BUG: scheduling while atomic: syz-executor272/4162/0x00000002
INFO: lockdep is turned off.
Modules linked in:
Preemption disabled at:
[<0000000000000000>] 0x0

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/23 20:56 linux-5.15.y 0c935c049b5c 4e8d3850 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan BUG: sleeping function called from invalid context in gfs2_glock_wait
2025/03/31 21:25 linux-5.15.y 0c935c049b5c d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan BUG: sleeping function called from invalid context in gfs2_glock_wait
2025/03/31 21:23 linux-5.15.y 0c935c049b5c d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan BUG: sleeping function called from invalid context in gfs2_glock_wait
2025/03/23 20:35 linux-5.15.y 0c935c049b5c 4e8d3850 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan BUG: sleeping function called from invalid context in gfs2_glock_wait
* Struck through repros no longer work on HEAD.