syzbot


possible deadlock in rfkill_epo

Status: upstream: reported C repro on 2023/10/25 15:01
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+9b8d3d01564bddc23b05@syzkaller.appspotmail.com
First crash: 350d, last: 1d12h
Bug presence (3)
Date Name Commit Repro Result
2024/01/26 linux-5.15.y (ToT) 6139f2a02fe0 C [report] possible deadlock in rfkill_epo
2023/10/28 upstream (ToT) 56567a20b22b C [report] possible deadlock in hci_rfkill_set_block
2024/01/26 upstream (ToT) ecb1b8288dc7 C Didn't crash
Fix bisection attempts (4)
Created Duration User Patch Repo Result
2024/08/08 08:52 1m fix candidate upstream error job log
2024/06/12 17:55 1m fix candidate upstream error job log
2024/03/25 09:44 4m fix candidate upstream error job log
2024/02/13 13:25 21m fix candidate upstream error job log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.15.158-syzkaller #0 Not tainted
------------------------------------------------------
kworker/1:1/25 is trying to acquire lock:
ffff0000d6ba0c28 ((work_completion)(&hdev->bg_scan_update)){+.+.}-{0:0}, at: __flush_work+0xd0/0x1c0 kernel/workqueue.c:3090

but task is already holding lock:
ffff800016cb9448 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_epo+0x58/0x158 net/rfkill/core.c:450

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (rfkill_global_mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       rfkill_register+0x44/0x7a4 net/rfkill/core.c:1045
       hci_register_dev+0x3e0/0x880 net/bluetooth/hci_core.c:3960
       __vhci_create_device drivers/bluetooth/hci_vhci.c:129 [inline]
       vhci_create_device+0x2c4/0x568 drivers/bluetooth/hci_vhci.c:153
       vhci_get_user drivers/bluetooth/hci_vhci.c:210 [inline]
       vhci_write+0x318/0x3b8 drivers/bluetooth/hci_vhci.c:290
       call_write_iter include/linux/fs.h:2172 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x87c/0xb3c fs/read_write.c:594
       ksys_write+0x15c/0x26c fs/read_write.c:647
       __do_sys_write fs/read_write.c:659 [inline]
       __se_sys_write fs/read_write.c:656 [inline]
       __arm64_sys_write+0x7c/0x90 fs/read_write.c:656
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #3 (&data->open_mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       vhci_send_frame+0x8c/0x10c drivers/bluetooth/hci_vhci.c:71
       hci_send_frame+0x194/0x2f0 net/bluetooth/hci_core.c:4252
       hci_sched_acl_pkt net/bluetooth/hci_core.c:4777 [inline]
       hci_sched_acl net/bluetooth/hci_core.c:4862 [inline]
       hci_tx_work+0x8d8/0x157c net/bluetooth/hci_core.c:4933
       process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
       worker_thread+0x910/0x1034 kernel/workqueue.c:2457
       kthread+0x37c/0x45c kernel/kthread.c:334
       ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

-> #2 ((work_completion)(&hdev->tx_work)){+.+.}-{0:0}:
       __flush_work+0xf8/0x1c0 kernel/workqueue.c:3090
       flush_work+0x24/0x38 kernel/workqueue.c:3115
       hci_dev_do_close+0x16c/0x1060 net/bluetooth/hci_core.c:1756
       hci_unregister_dev+0x228/0x4b4 net/bluetooth/hci_core.c:4036
       vhci_release+0x74/0xc4 drivers/bluetooth/hci_vhci.c:345
       __fput+0x30c/0x7f0 fs/file_table.c:280
       ____fput+0x20/0x30 fs/file_table.c:308
       task_work_run+0x130/0x1e4 kernel/task_work.c:164
       exit_task_work include/linux/task_work.h:32 [inline]
       do_exit+0x670/0x20bc kernel/exit.c:872
       do_group_exit+0x110/0x268 kernel/exit.c:994
       __do_sys_exit_group kernel/exit.c:1005 [inline]
       __se_sys_exit_group kernel/exit.c:1003 [inline]
       __wake_up_parent+0x0/0x60 kernel/exit.c:1003
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
       el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
       el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
       el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

-> #1 (&hdev->req_lock){+.+.}-{3:3}:
       __mutex_lock_common+0x194/0x2154 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_nested+0xa4/0xf8 kernel/locking/mutex.c:743
       hci_req_sync net/bluetooth/hci_request.c:278 [inline]
       bg_scan_update+0x9c/0x470 net/bluetooth/hci_request.c:2952
       process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
       worker_thread+0x910/0x1034 kernel/workqueue.c:2457
       kthread+0x37c/0x45c kernel/kthread.c:334
       ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

-> #0 ((work_completion)(&hdev->bg_scan_update)){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
       lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
       __flush_work+0xf8/0x1c0 kernel/workqueue.c:3090
       __cancel_work_timer+0x3ec/0x548 kernel/workqueue.c:3181
       cancel_work_sync+0x24/0x38 kernel/workqueue.c:3217
       hci_request_cancel_all+0xcc/0x2d0 net/bluetooth/hci_request.c:3522
       hci_dev_do_close+0x54/0x1060 net/bluetooth/hci_core.c:1736
       hci_rfkill_set_block+0xdc/0x1d0 net/bluetooth/hci_core.c:2235
       rfkill_set_block+0x18c/0x37c net/rfkill/core.c:345
       rfkill_epo+0x8c/0x158 net/rfkill/core.c:454
       __rfkill_handle_global_op net/rfkill/input.c:60 [inline]
       rfkill_op_handler+0x170/0x288 net/rfkill/input.c:108
       process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
       worker_thread+0x910/0x1034 kernel/workqueue.c:2457
       kthread+0x37c/0x45c kernel/kthread.c:334
       ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

other info that might help us debug this:

Chain exists of:
  (work_completion)(&hdev->bg_scan_update) --> &data->open_mutex --> rfkill_global_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(rfkill_global_mutex);
                               lock(&data->open_mutex);
                               lock(rfkill_global_mutex);
  lock((work_completion)(&hdev->bg_scan_update));

 *** DEADLOCK ***

3 locks held by kworker/1:1/25:
 #0: ffff0000c0020938 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x66c/0x11b8 kernel/workqueue.c:2283
 #1: ffff800018a77c00 ((rfkill_op_work).work){+.+.}-{0:0}, at: process_one_work+0x6ac/0x11b8 kernel/workqueue.c:2285
 #2: ffff800016cb9448 (rfkill_global_mutex){+.+.}-{3:3}, at: rfkill_epo+0x58/0x158 net/rfkill/core.c:450

stack backtrace:
CPU: 1 PID: 25 Comm: kworker/1:1 Not tainted 5.15.158-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Workqueue: events rfkill_op_handler
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 dump_stack+0x1c/0x58 lib/dump_stack.c:113
 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2011
 check_noncircular+0x2cc/0x378 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 kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x32d4/0x7638 kernel/locking/lockdep.c:5012
 lock_acquire+0x240/0x77c kernel/locking/lockdep.c:5623
 __flush_work+0xf8/0x1c0 kernel/workqueue.c:3090
 __cancel_work_timer+0x3ec/0x548 kernel/workqueue.c:3181
 cancel_work_sync+0x24/0x38 kernel/workqueue.c:3217
 hci_request_cancel_all+0xcc/0x2d0 net/bluetooth/hci_request.c:3522
 hci_dev_do_close+0x54/0x1060 net/bluetooth/hci_core.c:1736
 hci_rfkill_set_block+0xdc/0x1d0 net/bluetooth/hci_core.c:2235
 rfkill_set_block+0x18c/0x37c net/rfkill/core.c:345
 rfkill_epo+0x8c/0x158 net/rfkill/core.c:454
 __rfkill_handle_global_op net/rfkill/input.c:60 [inline]
 rfkill_op_handler+0x170/0x288 net/rfkill/input.c:108
 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
 worker_thread+0x910/0x1034 kernel/workqueue.c:2457
 kthread+0x37c/0x45c kernel/kthread.c:334
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

Crashes (1545):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/05 08:21 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 rfkill_epo
2024/02/10 01:28 linux-5.15.y 6139f2a02fe0 77b23aa1 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2023/10/28 14:50 linux-5.15.y 12952a23a5da 3c418d72 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/10/09 02:17 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/08 08:37 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/08 08:35 linux-5.15.y 3a5928702e71 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/07 10:22 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/07 00:04 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/06 17:59 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/05 08:14 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/05 04:57 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/04 09:57 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/03 18:54 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/03 06:30 linux-5.15.y 3a5928702e71 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/03 06:29 linux-5.15.y 3a5928702e71 a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/02 15:22 linux-5.15.y 3a5928702e71 02f9582a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/01 15:40 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/30 16:33 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/29 10:53 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/28 13:51 linux-5.15.y 3a5928702e71 ba29ff75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/28 05:50 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/28 03:50 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/25 13:15 linux-5.15.y 3a5928702e71 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/25 09:22 linux-5.15.y 3a5928702e71 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/25 06:54 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/24 19:54 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/24 16:13 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/09/24 08:59 linux-5.15.y 3a5928702e71 89298aad .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in rfkill_epo
2024/10/09 00:49 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 rfkill_epo
2024/10/05 02:46 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 rfkill_epo
2024/10/04 16:35 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 rfkill_epo
2024/10/04 04:07 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 rfkill_epo
2024/10/01 19:30 linux-5.15.y 3a5928702e71 ea2b66a6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/10/01 09:25 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/09/30 14:28 linux-5.15.y 3a5928702e71 bbd4e0a4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/09/29 15:57 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 rfkill_epo
2024/09/29 12:57 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 rfkill_epo
2024/09/29 01:10 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 rfkill_epo
2024/09/28 20:43 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 rfkill_epo
2024/09/28 12:25 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 rfkill_epo
2024/09/27 20:23 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/09/27 20:20 linux-5.15.y 3a5928702e71 440b26ec .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/09/27 16:09 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 rfkill_epo
2024/09/27 12:50 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 rfkill_epo
2024/09/26 19:38 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 rfkill_epo
2024/09/25 23:04 linux-5.15.y 3a5928702e71 0d19f247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/09/25 18:12 linux-5.15.y 3a5928702e71 349a68c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2024/09/25 02:24 linux-5.15.y 3a5928702e71 5643e0e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
2023/10/25 15:00 linux-5.15.y 12952a23a5da 17e6d526 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 possible deadlock in rfkill_epo
* Struck through repros no longer work on HEAD.