BUG: spinlock bad magic on CPU#0, syz.5.1087/9534 lock: 0xffff888060008a80, .magic: ffffffff, .owner: /-1, .owner_cpu: -1 CPU: 0 UID: 0 PID: 9534 Comm: syz.5.1087 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 spin_bug kernel/locking/spinlock_debug.c:78 [inline] debug_spin_lock_before kernel/locking/spinlock_debug.c:86 [inline] do_raw_spin_lock.cold+0x37/0x3c kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:156 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:181 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:594 [inline] try_to_wake_up+0xbd/0x1ca0 kernel/sched/core.c:4365 hrtimer_wakeup+0x47/0x60 kernel/time/hrtimer.c:2331 __run_hrtimer kernel/time/hrtimer.c:2075 [inline] __hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2132 hrtimer_interrupt+0x441/0xaa0 kernel/time/hrtimer.c:2251 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1051 [inline] __sysvec_apic_timer_interrupt+0x109/0x470 arch/x86/kernel/apic/apic.c:1068 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x9e/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:220 [inline] RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:229 Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 0a a0 fa f5 48 89 df e8 92 f6 fa f5 e8 2d ed 27 f6 fb bf 01 00 00 00 f2 b9 e9 f5 65 48 83 3d 51 54 ca 09 00 74 06 5b e9 01 4d 00 00 RSP: 0018:ffffc90003427c28 EFLAGS: 00000202 RAX: 0000000000000213 RBX: ffffffff90cb9920 RCX: 0000000000000080 RDX: 0000000000000001 RSI: ffffffff8e6212d7 RDI: 0000000000000001 RBP: 0000000000000060 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024b5d000 R13: 0000000069727785 R14: ffffffff8be00000 R15: 000000000000002a pci_user_write_config_dword+0x150/0x230 drivers/pci/access.c:278 proc_bus_pci_write+0x531/0x5e0 drivers/pci/proc.c:173 pde_write fs/proc/inode.c:330 [inline] proc_reg_write+0x240/0x330 fs/proc/inode.c:342 vfs_write+0x2aa/0x1050 fs/read_write.c:685 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4a3819f559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4a3900a028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4a38425fa0 RCX: 00007f4a3819f559 RDX: 000000000000008e RSI: 0000200000000140 RDI: 0000000000000003 RBP: 00007f4a38236b20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4a38426038 R14: 00007f4a38425fa0 R15: 00007ffc1e640068 ------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in kernel/locking/qspinlock.h:68:9 index 16382 is out of range for type 'long unsigned int [8]' CPU: 0 UID: 0 PID: 9534 Comm: syz.5.1087 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233 __ubsan_handle_out_of_bounds+0xcc/0xf0 lib/ubsan.c:455 decode_tail kernel/locking/qspinlock.h:68 [inline] __pv_queued_spin_lock_slowpath+0xbd7/0xc00 kernel/locking/qspinlock.c:307 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:37 [inline] queued_spin_lock_slowpath arch/x86/include/asm/paravirt-spinlock.h:71 [inline] queued_spin_lock include/asm-generic/qspinlock.h:115 [inline] do_raw_spin_lock+0x1e0/0x260 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:156 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:181 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:594 [inline] try_to_wake_up+0xbd/0x1ca0 kernel/sched/core.c:4365 hrtimer_wakeup+0x47/0x60 kernel/time/hrtimer.c:2331 __run_hrtimer kernel/time/hrtimer.c:2075 [inline] __hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2132 hrtimer_interrupt+0x441/0xaa0 kernel/time/hrtimer.c:2251 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1051 [inline] __sysvec_apic_timer_interrupt+0x109/0x470 arch/x86/kernel/apic/apic.c:1068 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x9e/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:220 [inline] RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:229 Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 0a a0 fa f5 48 89 df e8 92 f6 fa f5 e8 2d ed 27 f6 fb bf 01 00 00 00 f2 b9 e9 f5 65 48 83 3d 51 54 ca 09 00 74 06 5b e9 01 4d 00 00 RSP: 0018:ffffc90003427c28 EFLAGS: 00000202 RAX: 0000000000000213 RBX: ffffffff90cb9920 RCX: 0000000000000080 RDX: 0000000000000001 RSI: ffffffff8e6212d7 RDI: 0000000000000001 RBP: 0000000000000060 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888024b5d000 R13: 0000000069727785 R14: ffffffff8be00000 R15: 000000000000002a pci_user_write_config_dword+0x150/0x230 drivers/pci/access.c:278 proc_bus_pci_write+0x531/0x5e0 drivers/pci/proc.c:173 pde_write fs/proc/inode.c:330 [inline] proc_reg_write+0x240/0x330 fs/proc/inode.c:342 vfs_write+0x2aa/0x1050 fs/read_write.c:685 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4a3819f559 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4a3900a028 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4a38425fa0 RCX: 00007f4a3819f559 RDX: 000000000000008e RSI: 0000200000000140 RDI: 0000000000000003 RBP: 00007f4a38236b20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f4a38426038 R14: 00007f4a38425fa0 R15: 00007ffc1e640068 ---[ end trace ]--- ---------------- Code disassembly (best guess): 0: 90 nop 1: f3 0f 1e fa endbr64 5: 53 push %rbx 6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi b: 48 89 fb mov %rdi,%rbx e: 48 83 c7 18 add $0x18,%rdi 12: e8 0a a0 fa f5 call 0xf5faa021 17: 48 89 df mov %rbx,%rdi 1a: e8 92 f6 fa f5 call 0xf5faf6b1 1f: e8 2d ed 27 f6 call 0xf627ed51 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 f2 b9 e9 f5 call 0xf5e9ba21 <-- trapping instruction 2f: 65 48 83 3d 51 54 ca cmpq $0x0,%gs:0x9ca5451(%rip) # 0x9ca5489 36: 09 00 38: 74 06 je 0x40 3a: 5b pop %rbx 3b: e9 01 4d 00 00 jmp 0x4d41