bisecting fixing commit since 18445bf405cb331117bc98427b1ba6f12418ad17 building syzkaller on 94b457068cf474d9fcbfc5ca4cdb71b346166187 testing commit 18445bf405cb331117bc98427b1ba6f12418ad17 with gcc (GCC) 8.1.0 kernel signature: 8e85c8e659948999ac7c044faa406cf3ac5840fa0f60b6f8123e8070227da438 run #0: crashed: inconsistent lock state in sco_sock_timeout run #1: crashed: inconsistent lock state in sco_sock_timeout run #2: crashed: inconsistent lock state in sco_sock_timeout run #3: crashed: inconsistent lock state in sco_sock_timeout run #4: crashed: inconsistent lock state in sco_sock_timeout run #5: crashed: inconsistent lock state in sco_conn_del run #6: crashed: inconsistent lock state in sco_conn_del run #7: crashed: inconsistent lock state in sco_conn_del run #8: crashed: inconsistent lock state in sco_conn_del run #9: crashed: inconsistent lock state in sco_conn_del testing current HEAD 5c8fe583cce542aa0b84adc939ce85293de36e5e testing commit 5c8fe583cce542aa0b84adc939ce85293de36e5e with gcc (GCC) 8.1.0 kernel signature: dc1076492a2d6b72f46f9669e2f440f59fff9f491c375257f81f140a241f3a46 all runs: crashed: inconsistent lock state in sco_conn_del revisions tested: 2, total time: 26m51.071575123s (build: 9m34.911861294s, test: 16m30.593986749s) the crash still happens on HEAD commit msg: Linux 5.11-rc1 crash: inconsistent lock state in sco_conn_del ================================ WARNING: inconsistent lock state 5.11.0-rc1-syzkaller #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. syz-executor.2/17279 [HC0[0]:SC0[0]:HE1:SE1] takes: ffff88815a2710a0 (slock-AF_BLUETOOTH-BTPROTO_SCO){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff88815a2710a0 (slock-AF_BLUETOOTH-BTPROTO_SCO){+.?.}-{2:2}, at: sco_conn_del.isra.7+0x73/0x120 net/bluetooth/sco.c:176 {IN-SOFTIRQ-W} state was registered at: lock_acquire+0xf9/0x420 kernel/locking/lockdep.c:5437 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] sco_sock_timeout+0x1d/0x80 net/bluetooth/sco.c:83 call_timer_fn+0xa5/0x300 kernel/time/timer.c:1417 expire_timers kernel/time/timer.c:1462 [inline] __run_timers kernel/time/timer.c:1731 [inline] run_timer_softirq+0x20d/0x570 kernel/time/timer.c:1744 __do_softirq+0xeb/0x52d kernel/softirq.c:343 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x7c/0xa0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:226 [inline] __irq_exit_rcu kernel/softirq.c:420 [inline] irq_exit_rcu+0xec/0x110 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x57/0xf0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:60 arch_safe_halt arch/x86/include/asm/paravirt.h:150 [inline] acpi_safe_halt drivers/acpi/processor_idle.c:110 [inline] acpi_idle_do_entry+0x50/0x90 drivers/acpi/processor_idle.c:516 acpi_idle_enter+0xa0/0xf0 drivers/acpi/processor_idle.c:647 cpuidle_enter_state+0x94/0x520 drivers/cpuidle/cpuidle.c:237 cpuidle_enter+0x24/0x40 drivers/cpuidle/cpuidle.c:351 call_cpuidle kernel/sched/idle.c:158 [inline] cpuidle_idle_call kernel/sched/idle.c:239 [inline] do_idle+0x2dc/0x350 kernel/sched/idle.c:299 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:396 start_kernel+0x4f2/0x511 init/main.c:1061 secondary_startup_64_no_verify+0xb0/0xbb irq event stamp: 2635 hardirqs last enabled at (2635): [] __call_rcu kernel/rcu/tree.c:2997 [inline] hardirqs last enabled at (2635): [] call_rcu+0x1db/0x2d0 kernel/rcu/tree.c:3038 hardirqs last disabled at (2634): [] __call_rcu kernel/rcu/tree.c:2964 [inline] hardirqs last disabled at (2634): [] call_rcu+0x1ef/0x2d0 kernel/rcu/tree.c:3038 softirqs last enabled at (20): [] copy_init_fpstate_to_fpregs arch/x86/kernel/fpu/core.c:351 [inline] softirqs last enabled at (20): [] fpu__clear+0xa3/0x110 arch/x86/kernel/fpu/core.c:378 softirqs last disabled at (18): [] fpu__clear+0x1f/0x110 arch/x86/kernel/fpu/core.c:363 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(slock-AF_BLUETOOTH-BTPROTO_SCO); lock(slock-AF_BLUETOOTH-BTPROTO_SCO); *** DEADLOCK *** 3 locks held by syz-executor.2/17279: #0: ffff8881155c0f48 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x62/0x500 net/bluetooth/hci_core.c:1726 #1: ffff8881155c0078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_do_close+0xf5/0x500 net/bluetooth/hci_core.c:1763 #2: ffffffff84851308 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1459 [inline] #2: ffffffff84851308 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0x45/0xc0 net/bluetooth/hci_conn.c:1565 stack backtrace: CPU: 0 PID: 17279 Comm: syz-executor.2 Not tainted 5.11.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0xa3/0xc8 lib/dump_stack.c:120 valid_state kernel/locking/lockdep.c:3751 [inline] mark_lock_irq kernel/locking/lockdep.c:3954 [inline] mark_lock.part.50+0x500/0x550 kernel/locking/lockdep.c:4411 mark_lock kernel/locking/lockdep.c:4375 [inline] mark_usage kernel/locking/lockdep.c:4324 [inline] __lock_acquire+0x3b9/0x1770 kernel/locking/lockdep.c:4786 lock_acquire+0xf9/0x420 kernel/locking/lockdep.c:5437 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] sco_conn_del.isra.7+0x73/0x120 net/bluetooth/sco.c:176 hci_disconn_cfm include/net/bluetooth/hci_core.h:1462 [inline] hci_conn_hash_flush+0x64/0xc0 net/bluetooth/hci_conn.c:1565 hci_dev_do_close+0x1ed/0x500 net/bluetooth/hci_core.c:1776 hci_unregister_dev+0xc0/0x2c0 net/bluetooth/hci_core.c:3872 vhci_release+0x2a/0x60 drivers/bluetooth/hci_vhci.c:340 __fput+0xa1/0x250 fs/file_table.c:280 task_work_run+0x68/0xb0 kernel/task_work.c:140 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0x42f/0xd20 kernel/exit.c:823 do_group_exit+0x42/0xb0 kernel/exit.c:920 get_signal+0x151/0xc40 kernel/signal.c:2770 arch_do_signal_or_restart+0xaa/0x8f0 arch/x86/kernel/signal.c:811 handle_signal_work kernel/entry/common.c:147 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x1b7/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x40/0x80 kernel/entry/common.c:302 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d4d9 Code: Unable to access opcode bytes at RIP 0x45d4af. RSP: 002b:00007f6409b92cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 000000000118cf48 RCX: 000000000045d4d9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 000000000118cf48 RBP: 000000000118cf40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffc759c12cf R14: 00007f6409b939c0 R15: 000000000118cf4c