syzbot


BUG: sleeping function called from invalid context in glock_hash_walk

Status: fixed on 2024/01/30 15:47
Subsystems: gfs2
[Documentation on labels]
Reported-by: syzbot+10c6178a65acf04efe47@syzkaller.appspotmail.com
Fix commit: 6f861765464f fs: Block writes to mounted block devices
First crash: 227d, last: 121d
Cause bisection: introduced by (bisect log) :
commit 0be8432166a61abc537e1247e530f4b85970b56b
Author: Bob Peterson <rpeterso@redhat.com>
Date: Wed Aug 2 14:24:12 2023 +0000

  gfs2: Don't use filemap_splice_read

Crash: BUG: sleeping function called from invalid context in glock_hash_walk (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit 6f861765464f43a71462d52026fbddfc858239a5
Author: Jan Kara <jack@suse.cz>
Date: Wed Nov 1 17:43:10 2023 +0000

  fs: Block writes to mounted block devices

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [gfs2?] BUG: sleeping function called from invalid context in glock_hash_walk 2 (5) 2024/01/16 15:55
Last patch testing requests (10)
Created Duration User Patch Repo Result
2023/11/29 21:00 17m retest repro upstream report log
2023/11/29 20:39 11m retest repro upstream report log
2023/11/29 19:26 10m retest repro upstream report log
2023/11/29 19:26 14m retest repro upstream report log
2023/11/29 19:26 11m retest repro upstream report log
2023/11/29 19:26 11m retest repro upstream report log
2023/11/29 19:26 16m retest repro upstream report log
2023/09/20 11:19 15m retest repro upstream report log
2023/09/20 08:42 15m retest repro upstream report log
2023/09/20 08:42 9m retest repro upstream report log
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2024/01/15 23:09 4h24m bisect fix upstream job log (1)
2023/12/15 22:19 1h09m bisect fix upstream job log (0) log
2023/11/15 17:46 1h11m bisect fix upstream job log (0) log
2023/10/14 11:47 1h10m bisect fix upstream job log (0) log

Sample crash report:
loop0: rw=1, sector=3280942697285464, nr_sectors = 8 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:2081
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 5056, name: syz-executor.0
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
INFO: lockdep is turned off.
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 PID: 5056 Comm: syz-executor.0 Not tainted 6.5.0-syzkaller-11191-g6e32dfcccfcc #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 __might_resched+0x5cf/0x780 kernel/sched/core.c:10187
 glock_hash_walk+0x13b/0x1b0 fs/gfs2/glock.c:2081
 gfs2_flush_delete_work+0x1c/0x50 fs/gfs2/glock.c:2108
 gfs2_make_fs_ro+0x109/0x680 fs/gfs2/super.c:550
 signal_our_withdraw fs/gfs2/util.c:153 [inline]
 gfs2_withdraw+0x48a/0x11e0 fs/gfs2/util.c:334
 gfs2_ail1_empty+0x7d0/0x860 fs/gfs2/log.c:377
 gfs2_flush_revokes+0x5e/0x90 fs/gfs2/log.c:815
 revoke_lo_before_commit+0x2c/0x5f0 fs/gfs2/lops.c:868
 lops_before_commit fs/gfs2/lops.h:40 [inline]
 gfs2_log_flush+0xc93/0x25f0 fs/gfs2/log.c:1101
 gfs2_trans_end+0x39f/0x560 fs/gfs2/trans.c:158
 gfs2_iomap_begin_write fs/gfs2/bmap.c:1074 [inline]
 gfs2_iomap_begin+0xd3f/0x1360 fs/gfs2/bmap.c:1126
 iomap_iter+0x677/0xec0 fs/iomap/iter.c:91
 iomap_file_buffered_write+0x266/0x1020 fs/iomap/buffered-io.c:967
 gfs2_file_buffered_write+0x4cb/0x850 fs/gfs2/file.c:1059
 gfs2_file_write_iter+0x46a/0xe60 fs/gfs2/file.c:1157
 __kernel_write_iter+0x32a/0x7c0 fs/read_write.c:517
 dump_emit_page fs/coredump.c:888 [inline]
 dump_user_range+0x46c/0x910 fs/coredump.c:915
 elf_core_dump+0x3b75/0x4490 fs/binfmt_elf.c:2142
 do_coredump+0x1b73/0x2ab0 fs/coredump.c:764
 get_signal+0x145e/0x1840 kernel/signal.c:2878
 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:309
 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
 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+0x4d/0xc0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f49c167cae9
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:00007f49c09fe0c8 EFLAGS: 00000246 ORIG_RAX: 000000000000004d
RAX: ffffffffffffffe5 RBX: 00007f49c179bf80 RCX: 00007f49c167cae9
RDX: 0000000000000000 RSI: 0400000000000800 RDI: 0000000000000005
RBP: 00007f49c16c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f49c179bf80 R15: 00007ffc56fdf898
 </TASK>
BUG: scheduling while atomic: syz-executor.0/5056/0x00000002
INFO: lockdep is turned off.
Modules linked in:
Preemption disabled at:
[<0000000000000000>] 0x0

Crashes (31):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/04 06:11 upstream 6e32dfcccfcc 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] [mounted in repro #3] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/04 00:09 upstream 6e32dfcccfcc 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/03 15:47 upstream 92901222f83d 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/03 14:56 upstream 92901222f83d 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/03 02:59 upstream 92901222f83d 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 22:51 upstream 0468be89b3fa 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 09:24 upstream b84acc11b1c9 696ea0d2 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/05 14:48 upstream 3f86ed6ec0b3 0b6286dc .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/06 07:21 upstream 7733171926cc 0b6286dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/06 02:30 upstream 7733171926cc 0b6286dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/06 01:36 upstream 7733171926cc 0b6286dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/05 20:14 upstream 3f86ed6ec0b3 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/05 08:58 upstream 3f86ed6ec0b3 0b6286dc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/04 23:42 upstream 708283abf896 db3306a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/04 23:36 upstream 708283abf896 8bc9053e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/04 11:00 upstream 708283abf896 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/04 06:44 upstream 6e32dfcccfcc 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/04 05:28 upstream 6e32dfcccfcc 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/03 21:39 upstream 6e32dfcccfcc 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/03 14:05 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/03 13:36 upstream 92901222f83d 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 22:52 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 22:41 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 21:52 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 14:32 upstream 0468be89b3fa 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 06:59 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 03:10 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/02 02:59 upstream b84acc11b1c9 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/01 18:18 upstream 99d99825fc07 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/01 15:04 upstream 99d99825fc07 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
2023/09/01 15:04 upstream 99d99825fc07 696ea0d2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root BUG: sleeping function called from invalid context in glock_hash_walk
* Struck through repros no longer work on HEAD.