syzbot


possible deadlock in flush_workqueue

Status: auto-obsoleted due to no activity on 2023/08/09 18:38
Reported-by: syzbot+1c7630d66ab18ae3176d@syzkaller.appspotmail.com
First crash: 381d, last: 381d
Similar bugs (7)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-414 possible deadlock in flush_workqueue 1 1629d 1629d 0/1 auto-closed as invalid on 2020/03/10 11:29
linux-5.15 possible deadlock in flush_workqueue (2) 7 3d16h 44d 0/3 upstream: reported on 2024/03/13 19:04
upstream possible deadlock in flush_workqueue (2) C done done 256 1582d 2015d 15/26 fixed on 2020/01/31 18:49
linux-4.14 possible deadlock in flush_workqueue C done 15 1622d 1715d 1/1 fixed on 2019/12/18 17:48
linux-4.14 possible deadlock in flush_workqueue (2) 3 1585d 1590d 0/1 auto-closed as invalid on 2020/04/22 20:54
upstream possible deadlock in flush_workqueue net C 73762 2031d 2074d 11/26 fixed on 2018/10/11 14:33
linux-4.19 possible deadlock in flush_workqueue 3 1643d 1654d 0/1 auto-closed as invalid on 2020/02/25 05:02

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.15.106-syzkaller #0 Not tainted
--------------------------------------------
kworker/u5:0/32613 is trying to acquire lock:
ffff888029480138 ((wq_completion)hci0){+.+.}-{0:0}, at: flush_workqueue+0x154/0x1610 kernel/workqueue.c:2826

but task is already holding lock:
ffff888029480138 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2279

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

       CPU0
       ----
  lock((wq_completion)hci0);
  lock((wq_completion)hci0);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

2 locks held by kworker/u5:0/32613:
 #0: ffff888029480138 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x78a/0x10c0 kernel/workqueue.c:2279
 #1: ffffc9000858fd20 ((work_completion)(&hdev->error_reset)){+.+.}-{0:0}, at: process_one_work+0x7d0/0x10c0 kernel/workqueue.c:2281

stack backtrace:
CPU: 1 PID: 32613 Comm: kworker/u5:0 Not tainted 5.15.106-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
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
 print_deadlock_bug kernel/locking/lockdep.c:2946 [inline]
 check_deadlock kernel/locking/lockdep.c:2989 [inline]
 validate_chain+0x46cf/0x58b0 kernel/locking/lockdep.c:3774
 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5011
 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5622
 flush_workqueue+0x170/0x1610 kernel/workqueue.c:2826
 drain_workqueue+0xc5/0x390 kernel/workqueue.c:2991
 destroy_workqueue+0x7b/0xae0 kernel/workqueue.c:4426
 hci_release_dev+0x130/0x14c0 net/bluetooth/hci_core.c:4068
 bt_host_release+0x7f/0x90 net/bluetooth/hci_sysfs.c:91
 device_release+0x91/0x1c0
 kobject_cleanup lib/kobject.c:713 [inline]
 kobject_release lib/kobject.c:744 [inline]
 kref_put include/linux/kref.h:65 [inline]
 kobject_put+0x224/0x460 lib/kobject.c:761
 hci_dev_put include/net/bluetooth/hci_core.h:1203 [inline]
 hci_dev_do_close+0xe03/0x1000 net/bluetooth/hci_core.c:1856
 hci_error_reset+0xcd/0x160 net/bluetooth/hci_core.c:2340
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2306
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2453
 kthread+0x3f6/0x4f0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/11 18:37 linux-5.15.y d86dfc4d95cd 49faf98d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in flush_workqueue
* Struck through repros no longer work on HEAD.