syzbot


possible deadlock in sco_conn_del

Status: upstream: reported C repro on 2023/03/14 20:00
Bug presence: origin:lts-only
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+af5adc68f211c2849598@syzkaller.appspotmail.com
First crash: 647d, last: 14h51m
Bug presence (2)
Date Name Commit Repro Result
2023/09/25 linux-5.15.y (ToT) b911329317b4 C [report] possible deadlock in sco_conn_del
2023/09/25 upstream (ToT) 6465e260f487 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in sco_conn_del bluetooth C done done 279 585d 988d 22/28 fixed on 2023/07/01 16:05
linux-6.1 possible deadlock in sco_conn_del origin:lts-only C done 291 106d 648d 0/3 upstream: reported C repro on 2023/03/13 19:51
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2023/09/29 14:31 1h42m fix candidate upstream OK (0) job log

Sample crash report:
Bluetooth: hci0: hardware error 0x00
======================================================
WARNING: possible circular locking dependency detected
5.15.153-syzkaller #0 Not tainted
------------------------------------------------------
kworker/u5:2/3505 is trying to acquire lock:
ffff888072ac5120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1668 [inline]
ffff888072ac5120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_conn_del+0x104/0x300 net/bluetooth/sco.c:196

but task is already holding lock:
ffffffff8db25068 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1522 [inline]
ffffffff8db25068 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x220 net/bluetooth/hci_conn.c:1622

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (hci_cb_list_lock){+.+.}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       hci_connect_cfm include/net/bluetooth/hci_core.h:1507 [inline]
       hci_remote_features_evt+0x52f/0xb50 net/bluetooth/hci_event.c:3327
       hci_event_packet+0x6fe/0x1550 net/bluetooth/hci_event.c:6396
       hci_rx_work+0x232/0x990 net/bluetooth/hci_core.c:5156
       process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
       worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
       kthread+0x3f6/0x4f0 kernel/kthread.c:319
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

-> #1 (&hdev->lock){+.+.}-{3:3}:
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       __mutex_lock_common+0x1da/0x25a0 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
       sco_sock_connect+0x181/0x8e0 net/bluetooth/sco.c:587
       __sys_connect_file net/socket.c:1918 [inline]
       __sys_connect+0x38b/0x410 net/socket.c:1935
       __do_sys_connect net/socket.c:1945 [inline]
       __se_sys_connect net/socket.c:1942 [inline]
       __x64_sys_connect+0x76/0x80 net/socket.c:1942
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x61/0xcb

-> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
       __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
       lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
       lock_sock_nested+0x44/0x100 net/core/sock.c:3250
       lock_sock include/net/sock.h:1668 [inline]
       sco_conn_del+0x104/0x300 net/bluetooth/sco.c:196
       hci_disconn_cfm include/net/bluetooth/hci_core.h:1525 [inline]
       hci_conn_hash_flush+0x10d/0x220 net/bluetooth/hci_conn.c:1622
       hci_dev_do_close+0x9f6/0x1070 net/bluetooth/hci_core.c:1795
       hci_error_reset+0x106/0x2d0 net/bluetooth/hci_core.c:2341
       process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
       worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
       kthread+0x3f6/0x4f0 kernel/kthread.c:319
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

other info that might help us debug this:

Chain exists of:
  sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(hci_cb_list_lock);
                               lock(&hdev->lock);
                               lock(hci_cb_list_lock);
  lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO);

 *** DEADLOCK ***

5 locks held by kworker/u5:2/3505:
 #0: ffff88801d1ab938 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2283
 #1: ffffc90002567d20 ((work_completion)(&hdev->error_reset)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2285
 #2: ffff888079230ff0 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x63/0x1070 net/bluetooth/hci_core.c:1737
 #3: ffff888079230078 (&hdev->lock){+.+.}-{3:3}, at: hci_dev_do_close+0x431/0x1070 net/bluetooth/hci_core.c:1782
 #4: ffffffff8db25068 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_disconn_cfm include/net/bluetooth/hci_core.h:1522 [inline]
 #4: ffffffff8db25068 (hci_cb_list_lock){+.+.}-{3:3}, at: hci_conn_hash_flush+0xb8/0x220 net/bluetooth/hci_conn.c:1622

stack backtrace:
CPU: 1 PID: 3505 Comm: kworker/u5:2 Not tainted 5.15.153-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: hci0 hci_error_reset
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 check_noncircular+0x2f8/0x3b0 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623
 lock_sock_nested+0x44/0x100 net/core/sock.c:3250
 lock_sock include/net/sock.h:1668 [inline]
 sco_conn_del+0x104/0x300 net/bluetooth/sco.c:196
 hci_disconn_cfm include/net/bluetooth/hci_core.h:1525 [inline]
 hci_conn_hash_flush+0x10d/0x220 net/bluetooth/hci_conn.c:1622
 hci_dev_do_close+0x9f6/0x1070 net/bluetooth/hci_core.c:1795
 hci_error_reset+0x106/0x2d0 net/bluetooth/hci_core.c:2341
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:319

Crashes (380):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/02 22:58 linux-5.15.y 9465fef4ae35 eb2966c4 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2023/09/25 12:09 linux-5.15.y b911329317b4 0b6a67ac .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/20 21:12 linux-5.15.y 91786f140358 0f61b415 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/03 16:14 linux-5.15.y 72244eab0dad f00eed24 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/05/04 21:50 linux-5.15.y 284087d4f7d5 610f2a54 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/02/07 11:51 linux-5.15.y 6139f2a02fe0 6404acf9 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2023/05/14 22:13 linux-5.15.y b0ece631f84a 2b9ba477 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2023/06/04 09:46 linux-5.15.y 0ab06468cbd1 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2023/05/28 06:16 linux-5.15.y 1fe619a7d252 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2023/05/28 04:41 linux-5.15.y 1fe619a7d252 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2023/06/09 07:54 linux-5.15.y d7af3e5ba454 058b3a5a .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/27 15:16 linux-5.15.y 74cdd62cb470 65e8686b .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/20 19:55 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/09/29 19:33 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/09/08 11:27 linux-5.15.y 14e468424d3e 9750182a .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/11/05 08:44 linux-5.15.y 72244eab0dad 509da429 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2023/06/03 22:28 linux-5.15.y 0ab06468cbd1 a4ae4f42 .config console log report syz [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/20 01:06 linux-5.15.y 91786f140358 5905cb39 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/18 01:40 linux-5.15.y 963e654022cc a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/17 11:27 linux-5.15.y 963e654022cc f93b2b55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/16 14:11 linux-5.15.y 963e654022cc eec85da6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/02 10:40 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/11/30 03:10 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/11/29 20:26 linux-5.15.y 0a51d2d4527b 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/11/19 13:22 linux-5.15.y 0a51d2d4527b 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/11/09 02:57 linux-5.15.y 3c17fc483905 6b856513 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/29 17:37 linux-5.15.y 74cdd62cb470 66aeb999 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/27 20:33 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/25 17:19 linux-5.15.y 74cdd62cb470 045e728d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/25 15:41 linux-5.15.y 74cdd62cb470 045e728d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/22 06:01 linux-5.15.y 584a40a22cb9 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/16 08:03 linux-5.15.y 3a5928702e71 bde2d81c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/15 11:17 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/10 12:45 linux-5.15.y 3a5928702e71 0278d004 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/04 01:51 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/03 02:07 linux-5.15.y 3a5928702e71 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/02 02:24 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/10/01 01:09 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/09/30 05:47 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
2024/12/18 14:26 linux-5.15.y 963e654022cc a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/12/12 15:26 linux-5.15.y 0a51d2d4527b 530e80f8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/12/12 06:20 linux-5.15.y 0a51d2d4527b 6f1b0fa8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/12/08 23:31 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/12/08 03:23 linux-5.15.y 0a51d2d4527b 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/12/05 16:23 linux-5.15.y 0a51d2d4527b 29f61fce .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/12/01 00:33 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/29 14:03 linux-5.15.y 0a51d2d4527b 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/15 15:06 linux-5.15.y d98fd109f827 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/15 14:41 linux-5.15.y d98fd109f827 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/05 23:17 linux-5.15.y 72244eab0dad da38b4c9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/05 05:44 linux-5.15.y 72244eab0dad 509da429 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/11/03 11:02 linux-5.15.y 72244eab0dad f00eed24 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/26 03:29 linux-5.15.y 74cdd62cb470 65e8686b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/22 03:59 linux-5.15.y 584a40a22cb9 a93682b3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/20 21:27 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/19 05:05 linux-5.15.y 584a40a22cb9 cd6fc0a3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/12 07:21 linux-5.15.y 3a5928702e71 084d8178 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/08 11:27 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/07 09:18 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/07 06:20 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/06 10:55 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/06 08:32 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/05 22:29 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/05 16:23 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/10/05 05:06 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/09/29 14:26 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2024/09/27 16:11 linux-5.15.y 3a5928702e71 9314348a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in sco_conn_del
2023/03/14 20:00 linux-5.15.y 2ddbd0f967b3 0d5c4377 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in sco_conn_del
* Struck through repros no longer work on HEAD.