syzbot


BUG: spinlock bad magic in synchronize_srcu

Status: auto-obsoleted due to no activity on 2024/08/09 03:03
Reported-by: syzbot+f96d7ee4cf7139704974@syzkaller.appspotmail.com
First crash: 136d, last: 136d
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 (2) 1 9d03h 9d03h 0/3 upstream: reported on 2024/09/05 18:13
upstream BUG: spinlock bad magic in synchronize_srcu kvm C done done 3254 1082d 1453d 20/28 fixed on 2022/03/08 16:11

Sample crash report:
BUG: spinlock bad magic on CPU#1, syz-executor.3/3660
 lock: 0xffff8880b9b00040, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
CPU: 1 PID: 3660 Comm: syz-executor.3 Not tainted 5.15.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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_clear_sock drivers/block/nbd.c:1240 [inline]
 nbd_clear_sock_ioctl drivers/block/nbd.c:1379 [inline]
 __nbd_ioctl drivers/block/nbd.c:1407 [inline]
 nbd_ioctl+0x2bb/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:0x7f78d2638ea9
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:00007f78d0b690c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f78d2767120 RCX: 00007f78d2638ea9
RDX: 0000000000000000 RSI: 000000000000ab04 RDI: 0000000000000009
RBP: 00007f78d26854a4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f78d2767120 R15: 00007ffd40415798
 </TASK>
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 PID: 3660 Comm: syz-executor.3 Not tainted 5.15.157-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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 9e 76 5d 00 4c 8b 3b 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 05 77 5d 00 4d 89 37 4c 89 33 5b
RSP: 0018:ffffc90004477a58 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8880b9b000a0 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffc90004477b80 RDI: ffff8880b9b000c8
RBP: 1ffff1100f690ca7 R08: dffffc0000000000 R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8880b9b00040 R14: ffffc90004477b80 R15: 0000000000000000
FS:  00007f78d0b696c0(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200012c0 CR3: 00000000731be000 CR4: 00000000003506e0
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_clear_sock drivers/block/nbd.c:1240 [inline]
 nbd_clear_sock_ioctl drivers/block/nbd.c:1379 [inline]
 __nbd_ioctl drivers/block/nbd.c:1407 [inline]
 nbd_ioctl+0x2bb/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:0x7f78d2638ea9
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:00007f78d0b690c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f78d2767120 RCX: 00007f78d2638ea9
RDX: 0000000000000000 RSI: 000000000000ab04 RDI: 0000000000000009
RBP: 00007f78d26854a4 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f78d2767120 R15: 00007ffd40415798
 </TASK>
Modules linked in:
---[ end trace 628c6def0a6e0b6b ]---
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 9e 76 5d 00 4c 8b 3b 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 05 77 5d 00 4d 89 37 4c 89 33 5b
RSP: 0018:ffffc90004477a58 EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff8880b9b000a0 RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffc90004477b80 RDI: ffff8880b9b000c8
RBP: 1ffff1100f690ca7 R08: dffffc0000000000 R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8880b9b00040 R14: ffffc90004477b80 R15: 0000000000000000
FS:  00007f78d0b696c0(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200012c0 CR3: 00000000731be000 CR4: 00000000003506e0
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 9e 76 5d 00       	call   0x5d76be
  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 05 77 5d 00       	call   0x5d773e
  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/05/01 03:02 linux-5.15.y b925f60c6ee7 3ba885bc .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.