syzbot


WARNING: locking bug in srcu_gp_start_if_needed (2)

Status: upstream: reported on 2025/05/30 00:39
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+d7546350ee1d5ab2f7a8@syzkaller.appspotmail.com
First crash: 156d, last: 40d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] WARNING: locking bug in srcu_gp_start_if_needed (2) 0 (1) 2025/05/30 00:39
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: locking bug in srcu_gp_start_if_needed kvm bcachefs 4 2 503d 505d 26/29 fixed on 2024/07/09 19:14

Sample crash report:
  features: lz4,new_siphash,inline_data,new_extent_overwrite,btree_ptr_v2,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes
bcachefs (loop3): Using encoding defined by superblock: utf8-12.1.0
bcachefs (loop3): initializing new filesystem
bcachefs (loop3): going read-write
bcachefs (loop3): marking superblocks
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(1)
WARNING: CPU: 0 PID: 6148 at kernel/locking/lockdep.c:238 hlock_class kernel/locking/lockdep.c:238 [inline]
WARNING: CPU: 0 PID: 6148 at kernel/locking/lockdep.c:238 check_wait_context kernel/locking/lockdep.c:4854 [inline]
WARNING: CPU: 0 PID: 6148 at kernel/locking/lockdep.c:238 __lock_acquire+0x379/0xd20 kernel/locking/lockdep.c:5187
Modules linked in:
CPU: 0 UID: 0 PID: 6148 Comm: syz.3.37 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:hlock_class kernel/locking/lockdep.c:238 [inline]
RIP: 0010:check_wait_context kernel/locking/lockdep.c:4854 [inline]
RIP: 0010:__lock_acquire+0x379/0xd20 kernel/locking/lockdep.c:5187
Code: eb 33 90 e8 69 bd 27 03 85 c0 74 22 83 3d d2 72 06 0e 00 75 19 90 48 c7 c7 02 88 ba 8d 48 c7 c6 fc d4 a9 8d e8 b8 e5 e5 ff 90 <0f> 0b 90 90 90 31 c0 48 8b 3c 24 0f b6 98 c4 00 00 00 41 8b 46 20
RSP: 0018:ffffc900046b6458 EFLAGS: 00010046
RAX: 2de257ee3bb22f00 RBX: ffffe8ffffc7a258 RCX: 0000000000080000
RDX: ffffc9000c4dc000 RSI: 000000000006f9ce RDI: 000000000006f9cf
RBP: 000000000000164e R08: ffff8880b8624253 R09: 1ffff110170c484a
R10: dffffc0000000000 R11: ffffed10170c484b R12: 0000000000008000
R13: 0000000000000000 R14: ffff88802758e590 R15: ffff88802758e4f0
FS:  00007f399f9456c0(0000) GS:ffff888125c13000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f73edb54000 CR3: 0000000076448000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5868
 __raw_spin_trylock include/linux/spinlock_api_smp.h:90 [inline]
 _raw_spin_trylock+0x47/0x80 kernel/locking/spinlock.c:138
 spin_lock_irqsave_sdp_contention kernel/rcu/srcutree.c:375 [inline]
 srcu_gp_start_if_needed+0x31f/0x11d0 kernel/rcu/srcutree.c:1277
 __rcu_pending_enqueue fs/bcachefs/rcu_pending.c:498 [inline]
 rcu_pending_enqueue+0x729/0x880 fs/bcachefs/rcu_pending.c:531
 bkey_cached_free_noassert fs/bcachefs/btree_key_cache.c:115 [inline]
 bkey_cached_free+0x13a/0x1d0 fs/bcachefs/btree_key_cache.c:129
 bch2_btree_key_cache_drop+0x12b/0x7d0 fs/bcachefs/btree_key_cache.c:637
 bch2_trans_commit_write_locked fs/bcachefs/btree_trans_commit.c:785 [inline]
 do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:854 [inline]
 __bch2_trans_commit+0x7463/0x8870 fs/bcachefs/btree_trans_commit.c:1085
 bch2_trans_commit fs/bcachefs/btree_update.h:241 [inline]
 bch2_trans_mark_metadata_bucket+0x566/0x1260 fs/bcachefs/buckets.c:1091
 bch2_trans_mark_metadata_sectors fs/bcachefs/buckets.c:1108 [inline]
 __bch2_trans_mark_dev_sb fs/bcachefs/buckets.c:1148 [inline]
 bch2_trans_mark_dev_sb+0x3ed/0x7c0 fs/bcachefs/buckets.c:1176
 bch2_trans_mark_dev_sbs_flags+0x49c/0x500 fs/bcachefs/buckets.c:1186
 bch2_fs_initialize+0xd47/0x1550 fs/bcachefs/recovery.c:1235
 bch2_fs_start+0xaa0/0xda0 fs/bcachefs/super.c:1214
 bch2_fs_get_tree+0xb39/0x1520 fs/bcachefs/fs.c:2488
 vfs_get_tree+0x92/0x2b0 fs/super.c:1815
 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808
 do_mount fs/namespace.c:4136 [inline]
 __do_sys_mount fs/namespace.c:4347 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4324
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f399eb9034a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f399f944e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f399f944ef0 RCX: 00007f399eb9034a
RDX: 0000200000000140 RSI: 0000200000000100 RDI: 00007f399f944eb0
RBP: 0000200000000140 R08: 00007f399f944ef0 R09: 0000000002800000
R10: 0000000002800000 R11: 0000000000000246 R12: 0000200000000100
R13: 00007f399f944eb0 R14: 0000000000005a7a R15: 0000200000002080
 </TASK>

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/19 05:32 upstream cbf658dd0941 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in srcu_gp_start_if_needed
2025/09/18 23:13 upstream 8b789f2b7602 e2beed91 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in srcu_gp_start_if_needed
2025/07/29 11:15 upstream ced1b9e0392d c4a95487 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING: locking bug in srcu_gp_start_if_needed
2025/09/11 03:06 linux-next 5f540c4aade9 fdeaa69b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root WARNING: locking bug in srcu_gp_start_if_needed
2025/05/26 00:29 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci d7fa1af5b33e 2d4582d0 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in srcu_gp_start_if_needed
* Struck through repros no longer work on HEAD.