bisecting fixing commit since 3207316b3beec7e38e5dbe2f463df0cec71e0b97 building syzkaller on 79264ae39c1ef4b4875ab67d6f0c8c3e75aa6a34 testing commit 3207316b3beec7e38e5dbe2f463df0cec71e0b97 with gcc (GCC) 8.4.1 20210217 kernel signature: 8d6cba773993abb8ddd7879c74344e403b76e68494770a5a64cae86a3cc458f4 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_conn_del 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_sock_timeout 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 run #10: crashed: inconsistent lock state in sco_conn_del run #11: crashed: inconsistent lock state in sco_sock_timeout run #12: crashed: inconsistent lock state in sco_conn_del run #13: crashed: inconsistent lock state in sco_conn_del run #14: crashed: inconsistent lock state in sco_conn_del run #15: crashed: inconsistent lock state in sco_conn_del run #16: crashed: inconsistent lock state in sco_conn_del run #17: crashed: inconsistent lock state in sco_conn_del run #18: crashed: inconsistent lock state in sco_conn_del run #19: crashed: inconsistent lock state in sco_conn_del testing current HEAD 1722257b8ececec9b3b83a8b14058f8209d78071 testing commit 1722257b8ececec9b3b83a8b14058f8209d78071 with gcc (GCC) 8.4.1 20210217 kernel signature: e3235f08ca29fd69e323e5d277c65386602ce0b67c87ee65c7ed45cbac372e57 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_conn_del run #3: crashed: inconsistent lock state in sco_conn_del 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 revisions tested: 2, total time: 32m40.696217132s (build: 13m51.994467797s, test: 18m25.70262657s) the crash still happens on HEAD commit msg: Linux 4.19.193 crash: inconsistent lock state in sco_conn_del Bluetooth: hci4: command 0x0409 tx timeout Bluetooth: hci4: command 0x041b tx timeout Bluetooth: hci4: command 0x040f tx timeout ================================ WARNING: inconsistent lock state 4.19.193-syzkaller #0 Not tainted -------------------------------- inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. syz-executor.0/7834 [HC0[0]:SC0[0]:HE1:SE1] takes: 000000005ab641f3 (slock-AF_BLUETOOTH-BTPROTO_SCO){+.?.}, at: spin_lock include/linux/spinlock.h:329 [inline] 000000005ab641f3 (slock-AF_BLUETOOTH-BTPROTO_SCO){+.?.}, at: sco_conn_del+0xcc/0x170 net/bluetooth/sco.c:175 {IN-SOFTIRQ-W} state was registered at: lock_acquire+0x180/0x3a0 kernel/locking/lockdep.c:3908 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] sco_sock_timeout+0x27/0x120 net/bluetooth/sco.c:82 call_timer_fn+0x14c/0x510 kernel/time/timer.c:1338 expire_timers+0x255/0x3a0 kernel/time/timer.c:1375 __run_timers kernel/time/timer.c:1696 [inline] run_timer_softirq+0x1dc/0x570 kernel/time/timer.c:1709 __do_softirq+0x25f/0x919 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x17f/0x1c0 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:535 [inline] smp_apic_timer_interrupt+0x13e/0x540 arch/x86/kernel/apic/apic.c:1098 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 native_safe_halt+0x12/0x20 arch/x86/include/asm/irqflags.h:60 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline] default_idle+0x51/0x310 arch/x86/kernel/process.c:557 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:548 default_idle_call+0x6d/0x90 kernel/sched/idle.c:93 cpuidle_idle_call kernel/sched/idle.c:153 [inline] do_idle+0x451/0x570 kernel/sched/idle.c:263 cpu_startup_entry+0xc8/0xe0 kernel/sched/idle.c:369 rest_init+0x237/0x23d init/main.c:441 start_kernel+0x648/0x686 init/main.c:736 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:490 x86_64_start_kernel+0x76/0x79 arch/x86/kernel/head64.c:471 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 irq event stamp: 2063 hardirqs last enabled at (2063): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline] hardirqs last enabled at (2063): [] _raw_spin_unlock_irq+0x27/0x90 kernel/locking/spinlock.c:192 hardirqs last disabled at (2062): [] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline] hardirqs last disabled at (2062): [] _raw_spin_lock_irq+0x3c/0x90 kernel/locking/spinlock.c:160 softirqs last enabled at (0): [] copy_process.part.2+0x176b/0x7960 kernel/fork.c:1855 softirqs last disabled at (0): [<0000000000000000>] (null) 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.0/7834: #0: 000000008f16e1f9 (&hdev->req_lock){+.+.}, at: hci_dev_do_close+0x17a/0xe10 net/bluetooth/hci_core.c:1618 #1: 000000005299ad2d (&hdev->lock){+.+.}, at: hci_dev_do_close+0x278/0xe10 net/bluetooth/hci_core.c:1655 #2: 00000000487fb8c3 (hci_cb_list_lock){+.+.}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1259 [inline] #2: 00000000487fb8c3 (hci_cb_list_lock){+.+.}, at: hci_conn_hash_flush+0xd0/0x230 net/bluetooth/hci_conn.c:1512 stack backtrace: CPU: 0 PID: 7834 Comm: syz-executor.0 Not tainted 4.19.193-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 print_usage_bug.cold.38+0x433/0x563 kernel/locking/lockdep.c:2545 valid_state kernel/locking/lockdep.c:2558 [inline] mark_lock_irq kernel/locking/lockdep.c:2752 [inline] mark_lock+0xd44/0x12f0 kernel/locking/lockdep.c:3132 mark_irqflags kernel/locking/lockdep.c:3028 [inline] __lock_acquire+0x732/0x47c0 kernel/locking/lockdep.c:3373 lock_acquire+0x180/0x3a0 kernel/locking/lockdep.c:3908 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2d/0x40 kernel/locking/spinlock.c:144 spin_lock include/linux/spinlock.h:329 [inline] sco_conn_del+0xcc/0x170 net/bluetooth/sco.c:175 sco_disconn_cfm net/bluetooth/sco.c:1133 [inline] sco_disconn_cfm+0x56/0x90 net/bluetooth/sco.c:1126 hci_disconn_cfm include/net/bluetooth/hci_core.h:1262 [inline] hci_conn_hash_flush+0x114/0x230 net/bluetooth/hci_conn.c:1512 hci_dev_do_close+0x57e/0xe10 net/bluetooth/hci_core.c:1668 hci_unregister_dev+0x167/0x890 net/bluetooth/hci_core.c:3273 vhci_release+0x6b/0xe0 drivers/bluetooth/hci_vhci.c:354 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa6a/0x2d90 kernel/exit.c:870 do_group_exit+0xf8/0x2c0 kernel/exit.c:967 get_signal+0x30b/0x1970 kernel/signal.c:2589 do_signal+0x87/0x1870 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x159/0x1e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath+0x31a/0x3b0 arch/x86/entry/common.c:271 ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:407 RIP: 0033:0x465b09 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 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb270189188 EFLAGS: 00000246 ORIG_RAX: 0000000000000038 RAX: 0000000000000000 RBX: 000000000056bf60 RCX: 0000000000465b09 RDX: 9999999999999999 RSI: 0000000000000000 RDI: 00040000000007fc RBP: 00000000004b069f R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056bf60 R13: 00007ffe0116e1ff R14: 00007fb270189300 R15: 0000000000022000 Bluetooth: hci4: command 0x0419 tx timeout batman_adv: batadv0: Interface deactivated: batadv_slave_0 batman_adv: batadv0: Removing interface: batadv_slave_0 batman_adv: batadv0: Interface deactivated: batadv_slave_1 batman_adv: batadv0: Removing interface: batadv_slave_1 device bridge_slave_1 left promiscuous mode bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_0 left promiscuous mode bridge0: port 1(bridge_slave_0) entered disabled state device veth1_macvtap left promiscuous mode device veth0_macvtap left promiscuous mode device veth1_vlan left promiscuous mode device veth0_vlan left promiscuous mode device hsr_slave_1 left promiscuous mode device hsr_slave_0 left promiscuous mode team0 (unregistering): Port device team_slave_1 removed team0 (unregistering): Port device team_slave_0 removed bond0 (unregistering): Releasing backup interface bond_slave_1 bond0 (unregistering): Releasing backup interface bond_slave_0 bond0 (unregistering): Released all slaves IPVS: ftp: loaded support on port[0] = 21 chnl_net:caif_netlink_parms(): no params data found bridge0: port 1(bridge_slave_0) entered blocking state bridge0: port 1(bridge_slave_0) entered disabled state device bridge_slave_0 entered promiscuous mode bridge0: port 2(bridge_slave_1) entered blocking state bridge0: port 2(bridge_slave_1) entered disabled state device bridge_slave_1 entered promiscuous mode bond0: Enslaving bond_slave_0 as an active interface with an up link bond0: Enslaving bond_slave_1 as an active interface with an up link IPv6: ADDRCONF(NETDEV_UP): team_slave_0: link is not ready team0: Port device team_slave_0 added IPv6: ADDRCONF(NETDEV_UP): team_slave_1: link is not ready team0: Port device team_slave_1 added batman_adv: batadv0: Adding interface: batadv_slave_0 batman_adv: batadv0: The MTU of interface batadv_slave_0 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface batadv_slave_0 (retrying later): interface not active batman_adv: batadv0: Adding interface: batadv_slave_1 batman_adv: batadv0: The MTU of interface batadv_slave_1 is too small (1500) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to 1560 would solve the problem. batman_adv: batadv0: Not using interface batadv_slave_1 (retrying later): interface not active IPv6: ADDRCONF(NETDEV_UP): bridge_slave_0: link is not ready IPv6: ADDRCONF(NETDEV_UP): bridge_slave_1: link is not ready device hsr_slave_0 entered promiscuous mode device hsr_slave_1 entered promiscuous mode IPv6: ADDRCONF(NETDEV_UP): hsr_slave_0: link is not ready IPv6: ADDRCONF(NETDEV_UP): hsr_slave_1: link is not ready bridge0: port 2(bridge_slave_1) entered blocking state bridge0: port 2(bridge_slave_1) entered forwarding state bridge0: port 1(bridge_slave_0) entered blocking state bridge0: port 1(bridge_slave_0) entered forwarding state 8021q: adding VLAN 0 to HW filter on device bond0 IPv6: ADDRCONF(NETDEV_UP): veth0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready bridge0: port 1(bridge_slave_0) entered disabled state bridge0: port 2(bridge_slave_1) entered disabled state IPv6: ADDRCONF(NETDEV_UP): team0: link is not ready 8021q: adding VLAN 0 to HW filter on device team0 IPv6: ADDRCONF(NETDEV_CHANGE): bridge_slave_0: link becomes ready bridge0: port 1(bridge_slave_0) entered blocking state bridge0: port 1(bridge_slave_0) entered forwarding state hsr0: Slave A (hsr_slave_0) is not up; please bring it up to get a fully working HSR network hsr0: Slave B (hsr_slave_1) is not up; please bring it up to get a fully working HSR network Bluetooth: hci4: command 0x0409 tx timeout IPv6: ADDRCONF(NETDEV_UP): hsr0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): bridge_slave_1: link becomes ready bridge0: port 2(bridge_slave_1) entered blocking state bridge0: port 2(bridge_slave_1) entered forwarding state IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready IPv6: ADDRCONF(NETDEV_UP): vxcan0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready 8021q: adding VLAN 0 to HW filter on device batadv0 IPv6: ADDRCONF(NETDEV_UP): veth0_virt_wifi: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_virt_wifi: link becomes ready IPv6: ADDRCONF(NETDEV_UP): veth0_vlan: link is not ready IPv6: ADDRCONF(NETDEV_UP): vlan0: link is not ready IPv6: ADDRCONF(NETDEV_UP): vlan1: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_vlan: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vlan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): vlan1: link becomes ready device veth0_vlan entered promiscuous mode device veth1_vlan entered promiscuous mode IPv6: ADDRCONF(NETDEV_UP): macvlan0: link is not ready IPv6: ADDRCONF(NETDEV_UP): macvlan1: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth0_macvtap: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): macvlan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): macvlan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready device veth0_macvtap entered promiscuous mode IPv6: ADDRCONF(NETDEV_UP): macvtap0: link is not ready device veth1_macvtap entered promiscuous mode IPv6: ADDRCONF(NETDEV_UP): veth0_to_batadv: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth1_to_batadv: link is not ready batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3d) already exists on: batadv_slave_0 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: batadv0: Interface activated: batadv_slave_0 IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): macvtap0: link becomes ready batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ieee80211 phy36: Selected rate control algorithm 'minstrel_ht' IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 ieee80211 phy37: Selected rate control algorithm 'minstrel_ht' wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready Bluetooth: hci4: command 0x041b tx timeout Bluetooth: hci4: command 0x040f tx timeout