syzbot


BUG: spinlock bad magic in synchronize_srcu (2)

Status: upstream: reported on 2024/09/05 18:13
Reported-by: syzbot+3ccedbc9c3abab02c1fe@syzkaller.appspotmail.com
First crash: 40d, last: 40d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: spinlock bad magic in synchronize_srcu 1 167d 167d 0/3 auto-obsoleted due to no activity on 2024/08/09 03:03
upstream BUG: spinlock bad magic in synchronize_srcu kvm C done done 3254 1113d 1484d 20/28 fixed on 2022/03/08 16:11

Sample crash report:
block nbd0: shutting down sockets
BUG: spinlock bad magic on CPU#0, syz.0.224/5172
 lock: 0xffff8880b9000040, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 0 PID: 5172 Comm: syz.0.224 Not tainted 5.15.166-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 debug_spin_lock_before kernel/locking/spinlock_debug.c:85 [inline]
 do_raw_spin_lock+0x200/0x370 kernel/locking/spinlock_debug.c:114
 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:117 [inline]
 _raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162
 srcu_might_be_idle kernel/rcu/srcutree.c:767 [inline]
 synchronize_srcu+0xb3/0x1c0 kernel/rcu/srcutree.c:1008
 blk_mq_quiesce_queue+0x112/0x1d0 block/blk-mq.c:240
 nbd_clear_que drivers/block/nbd.c:848 [inline]
 nbd_start_device_ioctl drivers/block/nbd.c:1362 [inline]
 __nbd_ioctl drivers/block/nbd.c:1427 [inline]
 nbd_ioctl+0xa04/0xe10 drivers/block/nbd.c:1467
 blkdev_ioctl+0x333/0x6b0 block/ioctl.c:604
 block_ioctl+0xb1/0xf0 block/fops.c:493
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 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:0x7fa6455caef9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa643a23038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fa645784058 RCX: 00007fa6455caef9
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000007
RBP: 00007fa64563d01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fa645784058 R15: 00007ffd12f51c38
 </TASK>
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 5172 Comm: syz.0.224 Not tainted 5.15.166-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:rcu_segcblist_enqueue+0x9c/0xc0 kernel/rcu/rcu_segcblist.c:348
Code: c7 06 00 00 00 00 48 83 c3 20 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 2e 60 5d 00 4c 8b 3b 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 95 60 5d 00 4d 89 37 4c 89 33 5b
RSP: 0018:ffffc900034b7a58 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8880b90000a0 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffc900034b7b80 RDI: ffff8880b90000c8
RBP: 1ffff1100512e0a7 R08: dffffc0000000000 R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8880b9000040 R14: ffffc900034b7b80 R15: 0000000000000000
FS:  00007fa643a236c0(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc712834c85 CR3: 00000000674f9000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 srcu_gp_start_if_needed+0x156/0x8f0 kernel/rcu/srcutree.c:823
 __call_srcu kernel/rcu/srcutree.c:883 [inline]
 __synchronize_srcu+0x2b1/0x360 kernel/rcu/srcutree.c:929
 blk_mq_quiesce_queue+0x112/0x1d0 block/blk-mq.c:240
 nbd_clear_que drivers/block/nbd.c:848 [inline]
 nbd_start_device_ioctl drivers/block/nbd.c:1362 [inline]
 __nbd_ioctl drivers/block/nbd.c:1427 [inline]
 nbd_ioctl+0xa04/0xe10 drivers/block/nbd.c:1467
 blkdev_ioctl+0x333/0x6b0 block/ioctl.c:604
 block_ioctl+0xb1/0xf0 block/fops.c:493
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:860
 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:0x7fa6455caef9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fa643a23038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fa645784058 RCX: 00007fa6455caef9
RDX: 0000000000000000 RSI: 000000000000ab03 RDI: 0000000000000007
RBP: 00007fa64563d01e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fa645784058 R15: 00007ffd12f51c38
 </TASK>
Modules linked in:
---[ end trace 850981004da34617 ]---
RIP: 0010:rcu_segcblist_enqueue+0x9c/0xc0 kernel/rcu/rcu_segcblist.c:348
Code: c7 06 00 00 00 00 48 83 c3 20 48 89 d8 48 c1 e8 03 42 80 3c 20 00 74 08 48 89 df e8 2e 60 5d 00 4c 8b 3b 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 95 60 5d 00 4d 89 37 4c 89 33 5b
RSP: 0018:ffffc900034b7a58 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8880b90000a0 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffc900034b7b80 RDI: ffff8880b90000c8
RBP: 1ffff1100512e0a7 R08: dffffc0000000000 R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8880b9000040 R14: ffffc900034b7b80 R15: 0000000000000000
FS:  00007fa643a236c0(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc712834c85 CR3: 00000000674f9000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	c7 06 00 00 00 00    	movl   $0x0,(%rsi)
   6:	48 83 c3 20          	add    $0x20,%rbx
   a:	48 89 d8             	mov    %rbx,%rax
   d:	48 c1 e8 03          	shr    $0x3,%rax
  11:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1)
  16:	74 08                	je     0x20
  18:	48 89 df             	mov    %rbx,%rdi
  1b:	e8 2e 60 5d 00       	call   0x5d604e
  20:	4c 8b 3b             	mov    (%rbx),%r15
  23:	4c 89 f8             	mov    %r15,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	4c 89 ff             	mov    %r15,%rdi
  34:	e8 95 60 5d 00       	call   0x5d60ce
  39:	4d 89 37             	mov    %r14,(%r15)
  3c:	4c 89 33             	mov    %r14,(%rbx)
  3f:	5b                   	pop    %rbx

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/05 18:12 linux-5.15.y 14e468424d3e 464ac2ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan BUG: spinlock bad magic in synchronize_srcu
* Struck through repros no longer work on HEAD.