syzbot


WARNING: locking bug in rcu_pending_exit

Status: upstream: reported C repro on 2024/10/21 23:24
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+8d7226784b8fcb4c9d04@syzkaller.appspotmail.com
First crash: 49d, last: 2d01h
Cause bisection: introduced by (bisect log) :
commit 5db755fbb1a0de4a4cfd5d5edfaa19853b9c56e6
Author: Christoph Hellwig <hch@lst.de>
Date: Fri May 31 07:47:56 2024 +0000

  ubd: refactor the interrupt handler

Crash: BUG: unable to handle kernel NULL pointer dereference in srcu_invoke_callbacks (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] WARNING: locking bug in rcu_pending_exit 0 (3) 2024/12/01 20:03

Sample crash report:
bcachefs (da441363-bb6a-4ab9-999b-c1f40db4fee2): shutdown complete
------------[ cut here ]------------
Looking for class "->lock" with key rcu_pending_init.__key, but found a different class "&p->lock" with the same key
WARNING: CPU: 0 PID: 6892 at kernel/locking/lockdep.c:939 look_up_lock_class+0xdc/0x170 kernel/locking/lockdep.c:936
Modules linked in:
CPU: 0 UID: 0 PID: 6892 Comm: syz-executor223 Not tainted 6.12.0-syzkaller-11677-g2ba9f676d0a2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:look_up_lock_class+0xdc/0x170 kernel/locking/lockdep.c:936
Code: 01 0f 85 8a 00 00 00 c6 05 93 f3 45 04 01 90 49 8b 16 49 8b 76 18 48 8b 8b b8 00 00 00 48 c7 c7 e0 fa 0a 8c e8 e5 d5 95 f5 90 <0f> 0b 90 90 eb 61 90 e8 58 d9 f3 f8 e8 23 32 b5 f5 48 c7 c7 20 fa
RSP: 0018:ffffc900036e6e10 EFLAGS: 00010046
RAX: d8228172b281a900 RBX: ffffffff93c9d788 RCX: ffff88801ef19e00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900036e6f20 R08: ffffffff81568b22 R09: 1ffff920006dcd5c
R10: dffffc0000000000 R11: fffff520006dcd5d R12: ffffe8ffffc3e020
R13: ffffe8ffffc3e020 R14: ffffe8ffffc3e020 R15: ffffffff9a5739a0
FS:  00007f1d4027b6c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1d4027c000 CR3: 0000000024eaa000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 register_lock_class+0x102/0x980 kernel/locking/lockdep.c:1290
 __lock_acquire+0xf3/0x2100 kernel/locking/lockdep.c:5101
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849
 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline]
 _raw_spin_lock_irq+0xd3/0x120 kernel/locking/spinlock.c:170
 spin_lock_irq include/linux/spinlock.h:376 [inline]
 rcu_pending_has_pending_or_armed fs/bcachefs/rcu_pending.c:576 [inline]
 rcu_pending_exit+0x13f/0x7a0 fs/bcachefs/rcu_pending.c:594
 bch2_fs_btree_key_cache_exit+0x97f/0xab0 fs/bcachefs/btree_key_cache.c:741
 __bch2_fs_free fs/bcachefs/super.c:556 [inline]
 bch2_fs_release+0x206/0x7d0 fs/bcachefs/super.c:611
 kobject_cleanup lib/kobject.c:689 [inline]
 kobject_release lib/kobject.c:720 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x22f/0x480 lib/kobject.c:737
 bch2_fs_alloc fs/bcachefs/super.c:960 [inline]
 bch2_fs_open+0x1ebe/0x2f80 fs/bcachefs/super.c:2065
 bch2_fs_get_tree+0x738/0x1710 fs/bcachefs/fs.c:2157
 vfs_get_tree+0x90/0x2b0 fs/super.c:1814
 do_new_mount+0x2be/0xb40 fs/namespace.c:3507
 do_mount fs/namespace.c:3847 [inline]
 __do_sys_mount fs/namespace.c:4057 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:4034
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f1d40ad40aa
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 7e 09 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1d4027b088 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f1d4027b0a0 RCX: 00007f1d40ad40aa
RDX: 00000000200058c0 RSI: 0000000020005900 RDI: 00007f1d4027b0a0
RBP: 0000000000000004 R08: 00007f1d4027b0e0 R09: 00000000000058ae
R10: 0000000000010000 R11: 0000000000000282 R12: 00007f1d4027b0e0
R13: 0000000000010000 R14: 0000000000000003 R15: 0000000001000000
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/30 21:46 upstream 2ba9f676d0a2 68914665 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs WARNING: locking bug in rcu_pending_exit
2024/10/17 23:16 upstream 6efbea77b390 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs WARNING: locking bug in rcu_pending_exit
2024/12/04 01:06 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7b1d1d4cfac0 b50eb251 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in rcu_pending_exit
2024/11/20 08:13 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7b1d1d4cfac0 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in rcu_pending_exit
2024/11/14 02:44 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 8e9a54d7181b a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in rcu_pending_exit
2024/11/13 10:21 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci baa007e8da32 62026c85 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 WARNING: locking bug in rcu_pending_exit
* Struck through repros no longer work on HEAD.