syzbot


BUG: sleeping function called from invalid context in lockref_get_not_dead

Status: upstream: reported C repro on 2026/04/15 11:37
Subsystems: gfs2
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+642d0561f78362d67d3f@syzkaller.appspotmail.com
Fix commit: gfs2: fix quota init duplicate scan
Patched on: [ci-upstream-linux-next-kasan-gce-root ci-upstream-rust-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 50d, last: 30d
Cause bisection: failed (error log, bisect log)
  
✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision Error
5030b75d-c001-4057-a940-e1d8f5a0018e assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ✅ NetworkTrigger: ❌ PeripheralTrigger: ✅ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ BUG: sleeping function called from invalid context in lockref_get_not_dead 2026/05/31 13:05 2026/05/31 13:05 2026/05/31 13:53 6b4a844333e83556da95d61d7f207e7ef5cd4bc6
357d2386-aa9c-4165-949e-cc7217afd5fb assessment-security 💥 BUG: sleeping function called from invalid context in lockref_get_not_dead 2026/05/14 16:50 2026/05/14 16:50 2026/05/14 16:51 6ccb967e465e832a7bfd7a116ad00d52a0923a5d failed to run ["git" "pull" "origin" "HEAD" "--depth=1" "--allow-unrelated-histories"]: exit status 128 From /app/workdir/repo/linux * branch HEAD -> FETCH_HEAD Updating files: 15% (14336/93944) Updating files: 16% (15032/93944) Updating files: 17% (15971/93944) Updating files: 18% (16910/93944) Updating files: 19% (17850/93944) Updating files: 20% (18789/93944) Updating files: 21% (19729/93944) Updating files: 22% (20668/93944) Updating files: 23% (21608/93944) Updating files: 24% (22547/93944) Updating files: 25% (23486/93944) error: unable to write file arch/powerpc/include/asm/reg.h error: unable to write file arch/powerpc/include/asm/reg_8xx.h error: unable to write file arch/powerpc/include/asm/reg_booke.h error: unable to write file arch/powerpc/include/asm/reg_fsl_emb.h error: unable to write file arch/powerpc/include/asm/rheap.h error: unable to write file arch/powerpc/include/asm/rio.h error: unable to write file arch/powerpc/include/asm/rtas-types.h error: unable to write file arch/powerpc/include/asm/rtas-work-area.h error: unable to write file arch/powerpc/include/asm/rtas.h error: unable to write file arch/powerpc/include/asm/runlatch.h error: unable to write file arch/powerpc/include/asm/seccomp.h error: unable to write file arch/powerpc/include/asm/sections.h error: unable to write file arch/powerpc/include/asm/secure_boot.h error: unable to write file arch/powerpc/include/asm/security_features.h error: unable to write file arch/powerpc/include/asm/secvar.h error: unable to write file arch/powerpc/include/asm/serial.h error: unable to write file arch/powerpc/include/asm/set_memory.h error: unable to write file arch/powerpc/include/asm/setjmp.h error: unable to write file arch/powerpc/include/asm/setup.h error: unable to write file arch/powerpc/include/asm/sfp-machine.h error: unable to write file arch/powerpc/include/asm/shmparam.h error: unable to write file arch/powerpc/include/asm/signal.h error: unable to write file arch/powerpc/include/asm/simple_spinlock.h error: unable to write file arch/powerpc/include/asm/simple_spinlock_types.h error: unable to write file arch/powerpc/include/asm/smp.h error: unable to write file arch/powerpc/include/asm/smu.h error: unable to write file arch/powerpc/include/asm/sparsemem.h error: unable to write file arch/powerpc/include/asm/spinlock.h error: unable to write file arch/powerpc/include/asm/spinlock_types.h error: unable to write file arch/powerpc/include/asm/spu.h error: unable to write file arch/powerpc/include/asm/spu_csa.h error: unable to write file arch/powerpc/include/asm/spu_info.h error: unable to write file arch/powerpc/include/asm/spu_priv1.h error: unable to write file arch/powerpc/include/asm/sstep.h error: unable to write file arch/powerpc/include/asm/stackprotector.h error: unable to write file arch/powerpc/include/asm/stacktrace.h error: unable to write file arch/powerpc/include/asm/static_call.h error: unable to write file arch/powerpc/include/asm/string.h error: unable to write file arch/powerpc/include/asm/svm.h error: unable to write file arch/powerpc/include/asm/swab.h error: unable to write file arch/powerpc/include/asm/swiotlb.h error: unable to write file arch/powerpc/include/asm/switch_to.h error: unable to write file arch/powerpc/include/asm/synch.h error: unable to write file arch/powerpc/include/asm/syscall.h error: unable to write file arch/powerpc/include/asm/syscall_wrapper.h error: unable to write file arch/powerpc/include/asm/syscalls.h error: unable to write file arch/powerpc/include/asm/syscalls_32.h error: unable to write file arch/powerpc/include/asm/systemcfg.h error: unable to write file arch/powerpc/include/asm/task_size_32.h error: unable to write file arch/powerpc/include/asm/task_size_64.h error: unable to write file arch/powerpc/include/asm/tce.h error: unable to write file arch/powerpc/include/asm/text-patching.h error: unable to write file arch/powerpc/include/asm/thread_info.h error: unable to write file arch/powerpc/include/asm/time.h error: unable to write file arch/powerpc/include/a
Discussions (4)
Title Replies (including bot) Last reply
[PATCH] fs: gfs2: fix sleeping function called from invalid context 4 (4) 2026/05/11 15:06
Re: [syzbot] [gfs2?] BUG: sleeping function called from invalid context in lockref_get_not_dead 1 (2) 2026/04/23 10:52
Re: [syzbot] [gfs2?] BUG: sleeping function called from invalid context in lockref_get_not_dead 1 (2) 2026/04/21 15:01
[syzbot] [gfs2?] BUG: sleeping function called from invalid context in lockref_get_not_dead 0 (4) 2026/04/17 08:49
Last patch testing requests (5)
Created Duration User Patch Repo Result
2026/04/23 03:04 33m jie.wang@intel.com https://github.com/wangjie220704/linux.git fix/gfs2_quota_642d_v5 OK log
2026/04/21 07:14 43m jie.wang@intel.com https://github.com/wangjie220704/linux.git fix/gfs2_quota_642d_v4 OK log
2026/04/17 08:49 34m jie.wang@intel.com https://github.com/wangjie220704/linux.git fix/gfs2_quota_642d_v3 OK log
2026/04/17 08:30 23m jie.wang@intel.com https://github.com/wangjie220704/linux.git fix/gfs2_quota_642d_v2 OK log
2026/04/17 06:00 24m jie.wang@intel.com https://github.com/wangjie220704/linux.git fix/gfs2_quota_642d OK log

Sample crash report:
gfs2: fsid=syz:syz.0: first mount done, others may mount
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 6017, name: syz.0.17
preempt_count: 1, expected: 0
RCU nest depth: 1, expected: 1
4 locks held by syz.0.17/6017:
 #0: ffff888035b200d0 (&type->s_umount_key#54/1){+.+.}-{4:4}, at: alloc_super+0x28c/0xac0 fs/super.c:345
 #1: ffffffff8e620a78 (qd_lock){+.+.}-{3:3}, at: spin_lock include/linux/spinlock_rt.h:45 [inline]
 #1: ffffffff8e620a78 (qd_lock){+.+.}-{3:3}, at: gfs2_quota_init+0x854/0x1220 fs/gfs2/quota.c:1459
 #2: ffffffff8dfc8100 (rcu_read_lock){....}-{1:3}, at: rcu_lock_acquire include/linux/rcupdate.h:300 [inline]
 #2: ffffffff8dfc8100 (rcu_read_lock){....}-{1:3}, at: rcu_read_lock include/linux/rcupdate.h:838 [inline]
 #2: ffffffff8dfc8100 (rcu_read_lock){....}-{1:3}, at: __rt_spin_lock kernel/locking/spinlock_rt.c:50 [inline]
 #2: ffffffff8dfc8100 (rcu_read_lock){....}-{1:3}, at: rt_spin_lock+0x1e0/0x400 kernel/locking/spinlock_rt.c:57
 #3: ffff88805d082b78 (&lockref->lock#3){+.+.}-{3:3}, at: spin_lock include/linux/spinlock_rt.h:45 [inline]
 #3: ffff88805d082b78 (&lockref->lock#3){+.+.}-{3:3}, at: lockref_get_not_dead+0x28/0xd0 lib/lockref.c:155
Preemption disabled at:
[<ffffffff841e0f2b>] bit_spin_lock include/linux/bit_spinlock.h:38 [inline]
[<ffffffff841e0f2b>] hlist_bl_lock include/linux/list_bl.h:149 [inline]
[<ffffffff841e0f2b>] spin_lock_bucket+0x3b/0x150 fs/gfs2/quota.c:98
CPU: 1 UID: 0 PID: 6017 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 __might_resched+0x329/0x480 kernel/sched/core.c:9162
 __rt_spin_lock kernel/locking/spinlock_rt.c:48 [inline]
 rt_spin_lock+0xc2/0x400 kernel/locking/spinlock_rt.c:57
 spin_lock include/linux/spinlock_rt.h:45 [inline]
 lockref_get_not_dead+0x28/0xd0 lib/lockref.c:155
 gfs2_qd_search_bucket+0x139/0x210 fs/gfs2/quota.c:269
 gfs2_quota_init+0x86c/0x1220 fs/gfs2/quota.c:1461
 gfs2_make_fs_rw+0x143/0x230 fs/gfs2/super.c:149
 gfs2_fill_super+0x1bfd/0x2220 fs/gfs2/ops_fstype.c:1275
 get_tree_bdev_flags+0x431/0x4f0 fs/super.c:1694
 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1332
 vfs_get_tree+0x92/0x2a0 fs/super.c:1754
 fc_mount fs/namespace.c:1193 [inline]
 do_new_mount_fc fs/namespace.c:3758 [inline]
 do_new_mount+0x341/0xd30 fs/namespace.c:3834
 do_mount fs/namespace.c:4167 [inline]
 __do_sys_mount fs/namespace.c:4399 [inline]
 __se_sys_mount+0x31d/0x420 fs/namespace.c:4376
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc2a800da8a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff3b870ea8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff3b870f30 RCX: 00007fc2a800da8a
RDX: 00002000000124c0 RSI: 0000200000012500 RDI: 00007fff3b870ef0
RBP: 00002000000124c0 R08: 00007fff3b870f30 R09: 0000000000004800
R10: 0000000000004800 R11: 0000000000000246 R12: 0000200000012500
R13: 00007fff3b870ef0 R14: 00000000000125fd R15: 0000200000000180
 </TASK>
gfs2: fsid=syz:syz.0: Corruption found in quota_change0file: duplicate identifier in slot 48768
gfs2: fsid=syz:syz.0: warning: assertion "!qd->qd_change" failed - function = gfs2_qd_dispose, file = fs/gfs2/quota.c, line = 129
CPU: 1 UID: 0 PID: 6017 Comm: syz.0.17 Tainted: G        W           syzkaller #0 PREEMPT_{RT,(full)} 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/18/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
 gfs2_assert_warn_i+0x194/0x2c0 fs/gfs2/util.c:304
 gfs2_qd_dispose+0x466/0x570 fs/gfs2/quota.c:129
 gfs2_quota_init+0xcda/0x1220 fs/gfs2/quota.c:1470
 gfs2_make_fs_rw+0x143/0x230 fs/gfs2/super.c:149
 gfs2_fill_super+0x1bfd/0x2220 fs/gfs2/ops_fstype.c:1275
 get_tree_bdev_flags+0x431/0x4f0 fs/super.c:1694
 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1332
 vfs_get_tree+0x92/0x2a0 fs/super.c:1754
 fc_mount fs/namespace.c:1193 [inline]
 do_new_mount_fc fs/namespace.c:3758 [inline]
 do_new_mount+0x341/0xd30 fs/namespace.c:3834
 do_mount fs/namespace.c:4167 [inline]
 __do_sys_mount fs/namespace.c:4399 [inline]
 __se_sys_mount+0x31d/0x420 fs/namespace.c:4376
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc2a800da8a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff3b870ea8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff3b870f30 RCX: 00007fc2a800da8a
RDX: 00002000000124c0 RSI: 0000200000012500 RDI: 00007fff3b870ef0
RBP: 00002000000124c0 R08: 00007fff3b870f30 R09: 0000000000004800
R10: 0000000000004800 R11: 0000000000000246 R12: 0000200000012500
R13: 00007fff3b870ef0 R14: 00000000000125fd R15: 0000200000000180
 </TASK>
gfs2: fsid=syz:syz.0: found 1 quota changes

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/04/15 08:09 linux-next e6efabc0afca e2e976a8 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/05/03 18:42 linux-next b9303e6bff70 a0d91488 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/05/03 18:42 linux-next b9303e6bff70 a0d91488 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/05/03 18:42 linux-next b9303e6bff70 a0d91488 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/05/02 05:44 linux-next b9303e6bff70 753c55b9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/05/01 22:41 linux-next b9303e6bff70 753c55b9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/26 05:33 linux-next 7080e32d3f09 9c2d0995 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/24 21:13 linux-next 7080e32d3f09 1c2b9291 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/20 05:51 linux-next c7275b05bc42 303e2802 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/16 02:49 linux-next e6efabc0afca df15c5f3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/14 04:34 linux-next 1c7cc4904160 1a086e7c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/13 17:36 linux-next 1c7cc4904160 9530ccf9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
2026/04/13 17:36 linux-next 1c7cc4904160 9530ccf9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root BUG: sleeping function called from invalid context in lockref_get_not_dead
* Struck through repros no longer work on HEAD.