syzbot


inconsistent lock state in sco_conn_del

Status: upstream: reported C repro on 2020/09/07 19:17
Reported-by: syzbot+e5b57fedc9f4dbcb6d14@syzkaller.appspotmail.com
First crash: 1415d, last: 1036d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 inconsistent lock state in sco_conn_del syz error 47 633d 1453d 0/1 upstream: reported syz repro on 2020/07/31 12:31
upstream inconsistent lock state in sco_conn_del bluetooth C done 110 1058d 1442d 0/27 closed as dup on 2021/06/28 04:28

Sample crash report:
================================
WARNING: inconsistent lock state
4.19.167-syzkaller #0 Not tainted
--------------------------------
inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
syz-executor104/2297 [HC0[0]:SC0[0]:HE1:SE1] takes:
0000000080de040c (slock-AF_BLUETOOTH-BTPROTO_SCO){+.?.}, at: spin_lock include/linux/spinlock.h:329 [inline]
0000000080de040c (slock-AF_BLUETOOTH-BTPROTO_SCO){+.?.}, at: sco_conn_del+0xe2/0x240 net/bluetooth/sco.c:175
{IN-SOFTIRQ-W} state was registered at:
  __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
  _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144
  spin_lock include/linux/spinlock.h:329 [inline]
  sco_sock_timeout+0x31/0x210 net/bluetooth/sco.c:82
  call_timer_fn+0x177/0x700 kernel/time/timer.c:1338
  expire_timers+0x243/0x4e0 kernel/time/timer.c:1375
  __run_timers kernel/time/timer.c:1696 [inline]
  run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709
  __do_softirq+0x26c/0x9a0 kernel/softirq.c:292
  invoke_softirq kernel/softirq.c:372 [inline]
  irq_exit+0x215/0x260 kernel/softirq.c:412
  exiting_irq arch/x86/include/asm/apic.h:545 [inline]
  smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1094
  apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
  arch_local_irq_restore arch/x86/include/asm/paravirt.h:789 [inline]
  lock_release+0x429/0x8b0 kernel/locking/lockdep.c:3929
  alloc_set_pte+0x927/0x1a00 mm/memory.c:3588
  filemap_map_pages+0xd66/0x11c0 mm/filemap.c:2700
  do_fault_around mm/memory.c:3735 [inline]
  do_read_fault mm/memory.c:3769 [inline]
  do_fault mm/memory.c:3903 [inline]
  handle_pte_fault mm/memory.c:4134 [inline]
  __handle_mm_fault+0x2a8e/0x41c0 mm/memory.c:4258
  handle_mm_fault+0x436/0xb10 mm/memory.c:4295
  __do_page_fault+0x68e/0xd60 arch/x86/mm/fault.c:1412
  page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1205
irq event stamp: 1201
hardirqs last  enabled at (1201): [<ffffffff881607c4>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:168 [inline]
hardirqs last  enabled at (1201): [<ffffffff881607c4>] _raw_spin_unlock_irq+0x24/0x80 kernel/locking/spinlock.c:192
hardirqs last disabled at (1200): [<ffffffff88160455>] __raw_spin_lock_irq include/linux/spinlock_api_smp.h:126 [inline]
hardirqs last disabled at (1200): [<ffffffff88160455>] _raw_spin_lock_irq+0x35/0x80 kernel/locking/spinlock.c:160
softirqs last  enabled at (238): [<ffffffff876551d0>] sco_sock_connect+0x5b0/0xa90 net/bluetooth/sco.c:584
softirqs last disabled at (236): [<ffffffff868cce4b>] spin_lock_bh include/linux/spinlock.h:334 [inline]
softirqs last disabled at (236): [<ffffffff868cce4b>] release_sock+0x1b/0x1b0 net/core/sock.c:2879

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(slock-AF_BLUETOOTH-BTPROTO_SCO);
  <Interrupt>
    lock(slock-AF_BLUETOOTH-BTPROTO_SCO);

 *** DEADLOCK ***

3 locks held by syz-executor104/2297:
 #0: 00000000da46d8a2 (&hdev->req_lock){+.+.}, at: hci_dev_do_close+0x196/0xf10 net/bluetooth/hci_core.c:1616
 #1: 00000000d9a3f969 (&hdev->lock){+.+.}, at: hci_dev_do_close+0x2e0/0xf10 net/bluetooth/hci_core.c:1653
 #2: 00000000d345c75b (hci_cb_list_lock){+.+.}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1258 [inline]
 #2: 00000000d345c75b (hci_cb_list_lock){+.+.}, at: hci_conn_hash_flush+0xda/0x260 net/bluetooth/hci_conn.c:1512

stack backtrace:
CPU: 0 PID: 2297 Comm: syz-executor104 Not tainted 4.19.167-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+0x1fc/0x2fe lib/dump_stack.c:118
 print_usage_bug.cold+0x42e/0x570 kernel/locking/lockdep.c:2544
 valid_state kernel/locking/lockdep.c:2557 [inline]
 mark_lock_irq kernel/locking/lockdep.c:2751 [inline]
 mark_lock+0xc70/0x1160 kernel/locking/lockdep.c:3131
 mark_irqflags kernel/locking/lockdep.c:3027 [inline]
 __lock_acquire+0x6a8/0x3ff0 kernel/locking/lockdep.c:3372
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3907
 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:144
 spin_lock include/linux/spinlock.h:329 [inline]
 sco_conn_del+0xe2/0x240 net/bluetooth/sco.c:175
 sco_disconn_cfm+0x74/0xb0 net/bluetooth/sco.c:1133
 hci_disconn_cfm include/net/bluetooth/hci_core.h:1261 [inline]
 hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1512
 hci_dev_do_close+0x659/0xf10 net/bluetooth/hci_core.c:1666
 hci_unregister_dev+0x18b/0x910 net/bluetooth/hci_core.c:3271
 vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:354
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbed/0x2be0 kernel/exit.c:890
 do_group_exit+0x125/0x310 kernel/exit.c:993
 get_signal+0x3f2/0x1f70 kernel/signal.c:2589
 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:821
 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4474d9
Code: e8 4c e7 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 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 0f 83 3b 07 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f2106e8ecf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00000000006dcc28 RCX: 00000000004474d9
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00000000006dcc28
RBP: 00000000006dcc20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dcc2c
R13: 00007ffdccc5149f R14: 00007f2106e8f9c0 R15: 0000000000000064
Bluetooth: hci3: command 0x0405 tx timeout

Crashes (68):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/16 17:16 linux-4.19.y 675cc038067f 65a7a854 .config console log report syz C ci2-linux-4-19
2021/09/05 22:33 linux-4.19.y b172b44fcb17 d236a457 .config console log report syz ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/01/14 23:00 linux-4.19.y 675cc038067f 468dbb55 .config console log report syz ci2-linux-4-19
2021/09/22 02:00 linux-4.19.y b172b44fcb17 169724fe .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/20 08:35 linux-4.19.y b172b44fcb17 3d9c9a2a .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/19 11:31 linux-4.19.y b172b44fcb17 70b76c1d .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/17 08:58 linux-4.19.y b172b44fcb17 5b989942 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/15 19:35 linux-4.19.y b172b44fcb17 07e953c1 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/14 19:26 linux-4.19.y b172b44fcb17 07e953c1 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/10 10:54 linux-4.19.y b172b44fcb17 5ae8508a .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/09 09:31 linux-4.19.y b172b44fcb17 e2776ee4 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/08 03:47 linux-4.19.y b172b44fcb17 064c9eb7 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/06 22:43 linux-4.19.y b172b44fcb17 6ca60148 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/06 11:10 linux-4.19.y b172b44fcb17 6ca60148 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/06 01:35 linux-4.19.y b172b44fcb17 d236a457 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/05 15:41 linux-4.19.y b172b44fcb17 d236a457 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/04 05:39 linux-4.19.y b172b44fcb17 d236a457 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/09/02 06:10 linux-4.19.y e23d55af0e1f 7eb7e152 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/22 18:03 linux-4.19.y 59456c9cc40c b599f2fc .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/22 12:22 linux-4.19.y 59456c9cc40c b599f2fc .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/19 03:53 linux-4.19.y 59456c9cc40c a2fe1cb5 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/15 04:53 linux-4.19.y addba38e7c3b 2489ab88 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/12 15:37 linux-4.19.y addba38e7c3b 6972b106 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/05 14:42 linux-4.19.y 6ca2f514c578 7f7bb950 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/05 11:33 linux-4.19.y 6ca2f514c578 7f7bb950 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/04 06:45 linux-4.19.y 53bd76690e27 6c236867 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/08/04 01:01 linux-4.19.y 53bd76690e27 6c236867 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/27 02:45 linux-4.19.y 4938296e03bd fd511809 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/26 07:37 linux-4.19.y 4938296e03bd fd511809 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/22 21:13 linux-4.19.y 4938296e03bd 241790bb .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/18 20:44 linux-4.19.y fcfbdfe9626e f115ae98 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/10 20:18 linux-4.19.y 9f84340f012e 8f5a7b8c .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/10 11:31 linux-4.19.y 9f84340f012e 8f5a7b8c .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/08 19:37 linux-4.19.y 9f84340f012e 1b20171a .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/07 19:42 linux-4.19.y 9f84340f012e 95793bce .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/06 20:13 linux-4.19.y 9f84340f012e cca78469 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/06 06:38 linux-4.19.y 9f84340f012e 6c4484eb .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/05 07:42 linux-4.19.y 9f84340f012e 55aa55c2 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/07/01 11:54 linux-4.19.y 9f84340f012e 658ebc66 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/29 09:15 linux-4.19.y eb575cd5d7f6 9d2ab5df .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/26 20:22 linux-4.19.y eb575cd5d7f6 9d2ab5df .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/19 01:02 linux-4.19.y eb575cd5d7f6 aba2b2fb .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/17 23:00 linux-4.19.y eb575cd5d7f6 aba2b2fb .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/14 15:32 linux-4.19.y 9a2dc0e6c531 1ba81399 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/03 22:21 linux-4.19.y 1722257b8ece 0740de69 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/06/03 16:57 linux-4.19.y 1722257b8ece 0740de69 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/05/29 19:48 linux-4.19.y 6b7b0056defc 325a8dab .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/05/22 11:57 linux-4.19.y 1e986fe9ad15 3c7fef33 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/05/08 00:41 linux-4.19.y 3c8c23092588 bc5434be .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/05/05 14:45 linux-4.19.y 97a8651cadce 06c27ff5 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/04/29 06:29 linux-4.19.y 97a8651cadce 77e2b668 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/04/20 17:27 linux-4.19.y 2965db2e004c c0ced557 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/04/10 02:31 linux-4.19.y b4454811f122 6a81331a .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/03/17 02:59 linux-4.19.y 030194a5b292 fdb2bb2c .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/03/16 17:42 linux-4.19.y 030194a5b292 fdb2bb2c .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/03/10 07:52 linux-4.19.y 2cae3e25b706 26967e35 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/03/09 07:07 linux-4.19.y 2cae3e25b706 09fbf400 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/02/21 22:32 linux-4.19.y 255b58a2b3af a659b3f1 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/02/11 18:47 linux-4.19.y 811218eceeaa a5f86b15 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/02/10 10:10 linux-4.19.y 811218eceeaa 9c8b8541 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/01/23 17:44 linux-4.19.y 2263955bf7e7 52e37319 .config console log report info ci2-linux-4-19 inconsistent lock state in sco_conn_del
2021/01/15 05:59 linux-4.19.y 675cc038067f 65a7a854 .config console log report info ci2-linux-4-19
2021/01/14 19:12 linux-4.19.y 675cc038067f 468dbb55 .config console log report info ci2-linux-4-19
2021/01/03 13:34 linux-4.19.y 3207316b3bee 79264ae3 .config console log report info ci2-linux-4-19
2020/10/26 09:08 linux-4.19.y ad326970d25c a1839e81 .config console log report info ci2-linux-4-19
2020/09/30 18:54 linux-4.19.y 10ad6cfd5736 a9767fb2 .config console log report info ci2-linux-4-19
2020/09/07 19:16 linux-4.19.y c37da90efff5 abf9ba4f .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.