All of lore.kernel.org
 help / color / mirror / Atom feed
* [syzbot] INFO: task hung in hci_dev_close_sync
@ 2022-05-03 16:59 syzbot
  2022-05-04  4:48 ` Hillf Danton
  2022-05-29  5:55 ` syzbot
  0 siblings, 2 replies; 7+ messages in thread
From: syzbot @ 2022-05-03 16:59 UTC (permalink / raw)
  To: davem, edumazet, johan.hedberg, kuba, linux-bluetooth,
	linux-kernel, luiz.dentz, marcel, netdev, pabeni, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    9f9b9a2972eb Add linux-next specific files for 20220502
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1304f300f00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=db7d696bedca61f5
dashboard link: https://syzkaller.appspot.com/bug?extid=c56f6371c48cad0420f9
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c56f6371c48cad0420f9@syzkaller.appspotmail.com

INFO: task kworker/u5:1:3691 blocked for more than 143 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:1    state:D stack:27464 pid: 3691 ppid:     2 flags:0x00004000
Workqueue: hci4 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
INFO: task kworker/u5:2:3694 blocked for more than 143 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:2    state:D stack:27688 pid: 3694 ppid:     2 flags:0x00004000
Workqueue: hci1 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
INFO: task kworker/u5:3:3696 blocked for more than 143 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:3    state:D stack:27192 pid: 3696 ppid:     2 flags:0x00004000
Workqueue: hci2 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
INFO: task kworker/u5:5:5430 blocked for more than 144 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:5    state:D stack:27536 pid: 5430 ppid:     2 flags:0x00004000
Workqueue: hci0 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
INFO: task syz-executor.5:5786 blocked for more than 144 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.5  state:D stack:28408 pid: 5786 ppid:     1 flags:0x00000000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1131
 sock_ioctl+0x2f1/0x640 net/socket.c:1248
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f13b1488ea7
RSP: 002b:00007ffeca7dc868 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffeca7dcf28 RCX: 00007f13b1488ea7
RDX: 0000000000000000 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007f13b0bff700 R09: 00007f13b0bff700
R10: 00007f13b0bff9d0 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffeca7dc9c0 R14: 00007f13b159c9b8 R15: 000000000000000c
 </TASK>
INFO: task syz-executor.3:5903 blocked for more than 144 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.3  state:D stack:28408 pid: 5903 ppid:     1 flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1131
 sock_ioctl+0x2f1/0x640 net/socket.c:1248
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7ffbbf688ea7
RSP: 002b:00007fffc1092908 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fffc1092fc8 RCX: 00007ffbbf688ea7
RDX: 0000000000000001 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007ffbbedff700 R09: 00007ffbbedff700
R10: 00007ffbbedff9d0 R11: 0000000000000246 R12: 0000000000000003
R13: 00007fffc1092a60 R14: 00007ffbbf79c9b8 R15: 000000000000000c
 </TASK>
INFO: task syz-executor.2:6048 blocked for more than 144 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.2  state:D stack:28408 pid: 6048 ppid:     1 flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1131
 sock_ioctl+0x2f1/0x640 net/socket.c:1248
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7ff9c0e88ea7
RSP: 002b:00007ffed3e82ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffed3e83598 RCX: 00007ff9c0e88ea7
RDX: 0000000000000004 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007ff9c05ff700 R09: 00007ff9c05ff700
R10: 00007ff9c05ff9d0 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffed3e83030 R14: 00007ff9c0f9c9b8 R15: 000000000000000c
 </TASK>
INFO: task syz-executor.0:6305 blocked for more than 145 seconds.
      Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor.0  state:D stack:28408 pid: 6305 ppid:     1 flags:0x00000000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5106 [inline]
 __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
 schedule+0xd2/0x1f0 kernel/sched/core.c:6493
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1131
 sock_ioctl+0x2f1/0x640 net/socket.c:1248
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7fe7a4488ea7
RSP: 002b:00007ffcc64117a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffcc6411e68 RCX: 00007fe7a4488ea7
RDX: 0000000000000002 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000003 R08: 00007fe7a3bff700 R09: 00007fe7a3bff700
R10: 00007fe7a3bff9d0 R11: 0000000000000246 R12: 0000000000000003
R13: 00007ffcc6411900 R14: 00007fe7a459c9b8 R15: 000000000000000c
 </TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
 #0: ffffffff8bd84cd0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:502
1 lock held by rcu_tasks_trace/13:
 #0: ffffffff8bd84950 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:502
1 lock held by khungtaskd/29:
 #0: ffffffff8bd85820 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6491
2 locks held by getty/3356:
 #0: ffff88814bb09098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244
 #1: ffffc90002ce62e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xe50/0x13c0 drivers/tty/n_tty.c:2118
3 locks held by kworker/u5:1/3691:
 #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc90002f5fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff88801e529048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
3 locks held by kworker/u5:2/3694:
 #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc9000307fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff88801e165048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
3 locks held by kworker/u5:3/3696:
 #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc9000309fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff88807d985048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
3 locks held by kworker/u5:5/5430:
 #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc90002e3fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff888075741048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551

=============================================

NMI backtrace for cpu 0
CPU: 0 PID: 29 Comm: khungtaskd Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x1e6/0x230 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
 watchdog+0xc22/0xf90 kernel/hung_task.c:378
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 8 Comm: kworker/u4:0 Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events_unbound toggle_allocation_gate
RIP: 0010:__lock_acquire+0xd51/0x5660 kernel/locking/lockdep.c:5063
Code: 03 0f b6 04 02 84 c0 74 0d 3c 03 7f 09 48 8b 3c 24 e8 63 78 69 00 41 8b 85 58 0a 00 00 83 c0 01 83 f8 2f 41 89 85 58 0a 00 00 <0f> 87 eb 0b 00 00 3b 05 53 e2 1e 0e 41 be 01 00 00 00 0f 86 c8 00
RSP: 0018:ffffc900000d7748 EFLAGS: 00000097
RAX: 0000000000000006 RBX: ffffffff8f3c6c00 RCX: ffffffff815ddcee
RDX: 1ffff110021e1c5b RSI: 0000000000000001 RDI: ffffffff8f3c6c18
RBP: 000000000000f5e5 R08: 0000000000000000 R09: ffffffff9007b897
R10: fffffbfff200f712 R11: 0000000000000001 R12: ffff888010f0e3a8
R13: ffff888010f0d880 R14: 0000000000000000 R15: d4985ce4c67f0360
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c001d7d000 CR3: 000000000ba8e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 lock_acquire kernel/locking/lockdep.c:5665 [inline]
 lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630
 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
 _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
 spin_lock include/linux/spinlock.h:354 [inline]
 __get_locked_pte+0x154/0x270 mm/memory.c:1830
 get_locked_pte include/linux/mm.h:2127 [inline]
 __text_poke+0x1ae/0x8c0 arch/x86/kernel/alternative.c:1038
 text_poke arch/x86/kernel/alternative.c:1121 [inline]
 text_poke_bp_batch+0x433/0x6b0 arch/x86/kernel/alternative.c:1436
 text_poke_flush arch/x86/kernel/alternative.c:1542 [inline]
 text_poke_flush arch/x86/kernel/alternative.c:1539 [inline]
 text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1549
 arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146
 jump_label_update+0x32f/0x410 kernel/jump_label.c:830
 static_key_disable_cpuslocked+0x152/0x1b0 kernel/jump_label.c:207
 static_key_disable+0x16/0x20 kernel/jump_label.c:215
 toggle_allocation_gate mm/kfence/core.c:809 [inline]
 toggle_allocation_gate+0x183/0x390 mm/kfence/core.c:787
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
----------------
Code disassembly (best guess):
   0:	03 0f                	add    (%rdi),%ecx
   2:	b6 04                	mov    $0x4,%dh
   4:	02 84 c0 74 0d 3c 03 	add    0x33c0d74(%rax,%rax,8),%al
   b:	7f 09                	jg     0x16
   d:	48 8b 3c 24          	mov    (%rsp),%rdi
  11:	e8 63 78 69 00       	callq  0x697879
  16:	41 8b 85 58 0a 00 00 	mov    0xa58(%r13),%eax
  1d:	83 c0 01             	add    $0x1,%eax
  20:	83 f8 2f             	cmp    $0x2f,%eax
  23:	41 89 85 58 0a 00 00 	mov    %eax,0xa58(%r13)
* 2a:	0f 87 eb 0b 00 00    	ja     0xc1b <-- trapping instruction
  30:	3b 05 53 e2 1e 0e    	cmp    0xe1ee253(%rip),%eax        # 0xe1ee289
  36:	41 be 01 00 00 00    	mov    $0x1,%r14d
  3c:	0f                   	.byte 0xf
  3d:	86 c8                	xchg   %cl,%al


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] INFO: task hung in hci_dev_close_sync
  2022-05-03 16:59 [syzbot] INFO: task hung in hci_dev_close_sync syzbot
@ 2022-05-04  4:48 ` Hillf Danton
  2022-05-04  5:12   ` Tetsuo Handa
  2022-05-29  5:55 ` syzbot
  1 sibling, 1 reply; 7+ messages in thread
From: Hillf Danton @ 2022-05-04  4:48 UTC (permalink / raw)
  To: syzbot
  Cc: linux-mm, linux-kernel, Dmitry Vyukov, Tetsuo Handa, syzkaller-bugs

On Tue, 03 May 2022 09:59:16 -0700
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    9f9b9a2972eb Add linux-next specific files for 20220502
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1304f300f00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=db7d696bedca61f5
> dashboard link: https://syzkaller.appspot.com/bug?extid=c56f6371c48cad0420f9
> compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+c56f6371c48cad0420f9@syzkaller.appspotmail.com
> 
> INFO: task kworker/u5:1:3691 blocked for more than 143 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:kworker/u5:1    state:D stack:27464 pid: 3691 ppid:     2 flags:0x00004000
> Workqueue: hci4 hci_power_on
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>  </TASK>
> INFO: task kworker/u5:2:3694 blocked for more than 143 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:kworker/u5:2    state:D stack:27688 pid: 3694 ppid:     2 flags:0x00004000
> Workqueue: hci1 hci_power_on
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>  </TASK>
> INFO: task kworker/u5:3:3696 blocked for more than 143 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:kworker/u5:3    state:D stack:27192 pid: 3696 ppid:     2 flags:0x00004000
> Workqueue: hci2 hci_power_on
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>  </TASK>
> INFO: task kworker/u5:5:5430 blocked for more than 144 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:kworker/u5:5    state:D stack:27536 pid: 5430 ppid:     2 flags:0x00004000
> Workqueue: hci0 hci_power_on
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098

This is the problem, see below.

>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>  </TASK>
> INFO: task syz-executor.5:5786 blocked for more than 144 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:syz-executor.5  state:D stack:28408 pid: 5786 ppid:     1 flags:0x00000000
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7f13b1488ea7
> RSP: 002b:00007ffeca7dc868 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007ffeca7dcf28 RCX: 00007f13b1488ea7
> RDX: 0000000000000000 RSI: 00000000400448c9 RDI: 0000000000000003
> RBP: 0000000000000003 R08: 00007f13b0bff700 R09: 00007f13b0bff700
> R10: 00007f13b0bff9d0 R11: 0000000000000246 R12: 0000000000000003
> R13: 00007ffeca7dc9c0 R14: 00007f13b159c9b8 R15: 000000000000000c
>  </TASK>
> INFO: task syz-executor.3:5903 blocked for more than 144 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:syz-executor.3  state:D stack:28408 pid: 5903 ppid:     1 flags:0x00004000
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7ffbbf688ea7
> RSP: 002b:00007fffc1092908 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007fffc1092fc8 RCX: 00007ffbbf688ea7
> RDX: 0000000000000001 RSI: 00000000400448c9 RDI: 0000000000000003
> RBP: 0000000000000003 R08: 00007ffbbedff700 R09: 00007ffbbedff700
> R10: 00007ffbbedff9d0 R11: 0000000000000246 R12: 0000000000000003
> R13: 00007fffc1092a60 R14: 00007ffbbf79c9b8 R15: 000000000000000c
>  </TASK>
> INFO: task syz-executor.2:6048 blocked for more than 144 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:syz-executor.2  state:D stack:28408 pid: 6048 ppid:     1 flags:0x00004000
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7ff9c0e88ea7
> RSP: 002b:00007ffed3e82ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007ffed3e83598 RCX: 00007ff9c0e88ea7
> RDX: 0000000000000004 RSI: 00000000400448c9 RDI: 0000000000000003
> RBP: 0000000000000003 R08: 00007ff9c05ff700 R09: 00007ff9c05ff700
> R10: 00007ff9c05ff9d0 R11: 0000000000000246 R12: 0000000000000003
> R13: 00007ffed3e83030 R14: 00007ff9c0f9c9b8 R15: 000000000000000c
>  </TASK>
> INFO: task syz-executor.0:6305 blocked for more than 145 seconds.
>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:syz-executor.0  state:D stack:28408 pid: 6305 ppid:     1 flags:0x00000000
> Call Trace:
>  <TASK>
>  context_switch kernel/sched/core.c:5106 [inline]
>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>  vfs_ioctl fs/ioctl.c:51 [inline]
>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>  entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x7fe7a4488ea7
> RSP: 002b:00007ffcc64117a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
> RAX: ffffffffffffffda RBX: 00007ffcc6411e68 RCX: 00007fe7a4488ea7
> RDX: 0000000000000002 RSI: 00000000400448c9 RDI: 0000000000000003
> RBP: 0000000000000003 R08: 00007fe7a3bff700 R09: 00007fe7a3bff700
> R10: 00007fe7a3bff9d0 R11: 0000000000000246 R12: 0000000000000003
> R13: 00007ffcc6411900 R14: 00007fe7a459c9b8 R15: 000000000000000c
>  </TASK>
> 
> Showing all locks held in the system:
> 1 lock held by rcu_tasks_kthre/12:
>  #0: ffffffff8bd84cd0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:502
> 1 lock held by rcu_tasks_trace/13:
>  #0: ffffffff8bd84950 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:502
> 1 lock held by khungtaskd/29:
>  #0: ffffffff8bd85820 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6491
> 2 locks held by getty/3356:
>  #0: ffff88814bb09098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244
>  #1: ffffc90002ce62e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xe50/0x13c0 drivers/tty/n_tty.c:2118
> 3 locks held by kworker/u5:1/3691:
>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>  #1: ffffc90002f5fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>  #2: ffff88801e529048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
> 3 locks held by kworker/u5:2/3694:
>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>  #1: ffffc9000307fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>  #2: ffff88801e165048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
> 3 locks held by kworker/u5:3/3696:
>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>  #1: ffffc9000309fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>  #2: ffff88807d985048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
> 3 locks held by kworker/u5:5/5430:
>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>  #1: ffffc90002e3fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>  #2: ffff888075741048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
> 
> =============================================
> 
> NMI backtrace for cpu 0
> CPU: 0 PID: 29 Comm: khungtaskd Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Call Trace:
>  <TASK>
>  __dump_stack lib/dump_stack.c:88 [inline]
>  dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
>  nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
>  nmi_trigger_cpumask_backtrace+0x1e6/0x230 lib/nmi_backtrace.c:62
>  trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
>  check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
>  watchdog+0xc22/0xf90 kernel/hung_task.c:378
>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>  </TASK>
> Sending NMI from CPU 0 to CPUs 1:
> NMI backtrace for cpu 1
> CPU: 1 PID: 8 Comm: kworker/u4:0 Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> Workqueue: events_unbound toggle_allocation_gate
> RIP: 0010:__lock_acquire+0xd51/0x5660 kernel/locking/lockdep.c:5063
> Code: 03 0f b6 04 02 84 c0 74 0d 3c 03 7f 09 48 8b 3c 24 e8 63 78 69 00 41 8b 85 58 0a 00 00 83 c0 01 83 f8 2f 41 89 85 58 0a 00 00 <0f> 87 eb 0b 00 00 3b 05 53 e2 1e 0e 41 be 01 00 00 00 0f 86 c8 00
> RSP: 0018:ffffc900000d7748 EFLAGS: 00000097
> RAX: 0000000000000006 RBX: ffffffff8f3c6c00 RCX: ffffffff815ddcee
> RDX: 1ffff110021e1c5b RSI: 0000000000000001 RDI: ffffffff8f3c6c18
> RBP: 000000000000f5e5 R08: 0000000000000000 R09: ffffffff9007b897
> R10: fffffbfff200f712 R11: 0000000000000001 R12: ffff888010f0e3a8
> R13: ffff888010f0d880 R14: 0000000000000000 R15: d4985ce4c67f0360
> FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 000000c001d7d000 CR3: 000000000ba8e000 CR4: 00000000003506e0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  <TASK>
>  lock_acquire kernel/locking/lockdep.c:5665 [inline]
>  lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630
>  __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
>  _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
>  spin_lock include/linux/spinlock.h:354 [inline]
>  __get_locked_pte+0x154/0x270 mm/memory.c:1830
>  get_locked_pte include/linux/mm.h:2127 [inline]
>  __text_poke+0x1ae/0x8c0 arch/x86/kernel/alternative.c:1038
>  text_poke arch/x86/kernel/alternative.c:1121 [inline]
>  text_poke_bp_batch+0x433/0x6b0 arch/x86/kernel/alternative.c:1436
>  text_poke_flush arch/x86/kernel/alternative.c:1542 [inline]
>  text_poke_flush arch/x86/kernel/alternative.c:1539 [inline]
>  text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1549
>  arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146
>  jump_label_update+0x32f/0x410 kernel/jump_label.c:830
>  static_key_disable_cpuslocked+0x152/0x1b0 kernel/jump_label.c:207
>  static_key_disable+0x16/0x20 kernel/jump_label.c:215
>  toggle_allocation_gate mm/kfence/core.c:809 [inline]
>  toggle_allocation_gate+0x183/0x390 mm/kfence/core.c:787
>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>  </TASK>
> ----------------
> Code disassembly (best guess):
>    0:	03 0f                	add    (%rdi),%ecx
>    2:	b6 04                	mov    $0x4,%dh
>    4:	02 84 c0 74 0d 3c 03 	add    0x33c0d74(%rax,%rax,8),%al
>    b:	7f 09                	jg     0x16
>    d:	48 8b 3c 24          	mov    (%rsp),%rdi
>   11:	e8 63 78 69 00       	callq  0x697879
>   16:	41 8b 85 58 0a 00 00 	mov    0xa58(%r13),%eax
>   1d:	83 c0 01             	add    $0x1,%eax
>   20:	83 f8 2f             	cmp    $0x2f,%eax
>   23:	41 89 85 58 0a 00 00 	mov    %eax,0xa58(%r13)
> * 2a:	0f 87 eb 0b 00 00    	ja     0xc1b <-- trapping instruction
>   30:	3b 05 53 e2 1e 0e    	cmp    0xe1ee253(%rip),%eax        # 0xe1ee289
>   36:	41 be 01 00 00 00    	mov    $0x1,%r14d
>   3c:	0f                   	.byte 0xf
>   3d:	86 c8                	xchg   %cl,%al
> 
> 
> ---
> This report is generated by a bot. It may contain errors.
> See https://goo.gl/tpsmEJ for more information about syzbot.
> syzbot engineers can be reached at syzkaller@googlegroups.com.
> 
> syzbot will keep track of this issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
> 

Given the call trace reported,

	process_one_work
	  lock_map_acquire(&pwq->wq->lockdep_map);
	  lock_map_acquire(&lockdep_map);
	  hci_power_on
	    hci_dev_do_close
	      hci_req_sync_lock(hdev);
	      hci_dev_close_sync(hdev);
	        cancel_work_sync(&hdev->power_on);
		  __cancel_work_timer()
		    __flush_work(work, true);
			if (!from_cancel) {
				lock_map_acquire(&work->lockdep_map);
				lock_map_release(&work->lockdep_map);
			}
	      hci_req_sync_unlock(hdev);


syzbot should have been able to catch cancel_work_sync() in work context
by checking lockdep_map in __flush_work() for both flush and cancel.

Hillf

--- y/kernel/workqueue.c
+++ x/kernel/workqueue.c
@@ -3075,10 +3075,10 @@ static bool __flush_work(struct work_str
 	if (WARN_ON(!work->func))
 		return false;
 
-	if (!from_cancel) {
+	//if (!from_cancel) {
 		lock_map_acquire(&work->lockdep_map);
 		lock_map_release(&work->lockdep_map);
-	}
+	//}
 
 	if (start_flush_work(work, &barr, from_cancel)) {
 		wait_for_completion(&barr.done);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] INFO: task hung in hci_dev_close_sync
  2022-05-04  4:48 ` Hillf Danton
@ 2022-05-04  5:12   ` Tetsuo Handa
  2022-05-04  9:24     ` Johannes Berg
  0 siblings, 1 reply; 7+ messages in thread
From: Tetsuo Handa @ 2022-05-04  5:12 UTC (permalink / raw)
  To: Johannes Berg, Tejun Heo
  Cc: linux-kernel, Dmitry Vyukov, syzkaller-bugs, Hillf Danton, syzbot

Hello, Johannes.

This seems to be a question regarding commit 87915adc3f0acdf0 ("workqueue: re-add lockdep dependencies for flushing").

On 2022/05/04 13:48, Hillf Danton wrote:
> On Tue, 03 May 2022 09:59:16 -0700
>> Hello,
>>
>> syzbot found the following issue on:
>>
>> HEAD commit:    9f9b9a2972eb Add linux-next specific files for 20220502
>> git tree:       linux-next
>> console output: https://syzkaller.appspot.com/x/log.txt?x=1304f300f00000
>> kernel config:  https://syzkaller.appspot.com/x/.config?x=db7d696bedca61f5
>> dashboard link: https://syzkaller.appspot.com/bug?extid=c56f6371c48cad0420f9
>> compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
>>
>> Unfortunately, I don't have any reproducer for this issue yet.
>>
>> IMPORTANT: if you fix the issue, please add the following tag to the commit:
>> Reported-by: syzbot+c56f6371c48cad0420f9@syzkaller.appspotmail.com
>>
>> INFO: task kworker/u5:1:3691 blocked for more than 143 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:kworker/u5:1    state:D stack:27464 pid: 3691 ppid:     2 flags:0x00004000
>> Workqueue: hci4 hci_power_on
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
>>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>>  </TASK>
>> INFO: task kworker/u5:2:3694 blocked for more than 143 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:kworker/u5:2    state:D stack:27688 pid: 3694 ppid:     2 flags:0x00004000
>> Workqueue: hci1 hci_power_on
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
>>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>>  </TASK>
>> INFO: task kworker/u5:3:3696 blocked for more than 143 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:kworker/u5:3    state:D stack:27192 pid: 3696 ppid:     2 flags:0x00004000
>> Workqueue: hci2 hci_power_on
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
>>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>>  </TASK>
>> INFO: task kworker/u5:5:5430 blocked for more than 144 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:kworker/u5:5    state:D stack:27536 pid: 5430 ppid:     2 flags:0x00004000
>> Workqueue: hci0 hci_power_on
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  __flush_work+0x56c/0xb10 kernel/workqueue.c:3098
> 
> This is the problem, see below.
> 
>>  __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3185
>>  hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4092
>>  hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
>>  hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
>>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>>  </TASK>
>> INFO: task syz-executor.5:5786 blocked for more than 144 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:syz-executor.5  state:D stack:28408 pid: 5786 ppid:     1 flags:0x00000000
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>>  vfs_ioctl fs/ioctl.c:51 [inline]
>>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>>  entry_SYSCALL_64_after_hwframe+0x44/0xae
>> RIP: 0033:0x7f13b1488ea7
>> RSP: 002b:00007ffeca7dc868 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
>> RAX: ffffffffffffffda RBX: 00007ffeca7dcf28 RCX: 00007f13b1488ea7
>> RDX: 0000000000000000 RSI: 00000000400448c9 RDI: 0000000000000003
>> RBP: 0000000000000003 R08: 00007f13b0bff700 R09: 00007f13b0bff700
>> R10: 00007f13b0bff9d0 R11: 0000000000000246 R12: 0000000000000003
>> R13: 00007ffeca7dc9c0 R14: 00007f13b159c9b8 R15: 000000000000000c
>>  </TASK>
>> INFO: task syz-executor.3:5903 blocked for more than 144 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:syz-executor.3  state:D stack:28408 pid: 5903 ppid:     1 flags:0x00004000
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>>  vfs_ioctl fs/ioctl.c:51 [inline]
>>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>>  entry_SYSCALL_64_after_hwframe+0x44/0xae
>> RIP: 0033:0x7ffbbf688ea7
>> RSP: 002b:00007fffc1092908 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
>> RAX: ffffffffffffffda RBX: 00007fffc1092fc8 RCX: 00007ffbbf688ea7
>> RDX: 0000000000000001 RSI: 00000000400448c9 RDI: 0000000000000003
>> RBP: 0000000000000003 R08: 00007ffbbedff700 R09: 00007ffbbedff700
>> R10: 00007ffbbedff9d0 R11: 0000000000000246 R12: 0000000000000003
>> R13: 00007fffc1092a60 R14: 00007ffbbf79c9b8 R15: 000000000000000c
>>  </TASK>
>> INFO: task syz-executor.2:6048 blocked for more than 144 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:syz-executor.2  state:D stack:28408 pid: 6048 ppid:     1 flags:0x00004000
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>>  vfs_ioctl fs/ioctl.c:51 [inline]
>>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>>  entry_SYSCALL_64_after_hwframe+0x44/0xae
>> RIP: 0033:0x7ff9c0e88ea7
>> RSP: 002b:00007ffed3e82ed8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
>> RAX: ffffffffffffffda RBX: 00007ffed3e83598 RCX: 00007ff9c0e88ea7
>> RDX: 0000000000000004 RSI: 00000000400448c9 RDI: 0000000000000003
>> RBP: 0000000000000003 R08: 00007ff9c05ff700 R09: 00007ff9c05ff700
>> R10: 00007ff9c05ff9d0 R11: 0000000000000246 R12: 0000000000000003
>> R13: 00007ffed3e83030 R14: 00007ff9c0f9c9b8 R15: 000000000000000c
>>  </TASK>
>> INFO: task syz-executor.0:6305 blocked for more than 145 seconds.
>>       Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
>> task:syz-executor.0  state:D stack:28408 pid: 6305 ppid:     1 flags:0x00000000
>> Call Trace:
>>  <TASK>
>>  context_switch kernel/sched/core.c:5106 [inline]
>>  __schedule+0xa9a/0x4cc0 kernel/sched/core.c:6421
>>  schedule+0xd2/0x1f0 kernel/sched/core.c:6493
>>  schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1883
>>  do_wait_for_common kernel/sched/completion.c:85 [inline]
>>  __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
>>  flush_workqueue+0x44e/0x1440 kernel/workqueue.c:2884
>>  hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
>>  hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
>>  sock_do_ioctl+0xcc/0x230 net/socket.c:1131
>>  sock_ioctl+0x2f1/0x640 net/socket.c:1248
>>  vfs_ioctl fs/ioctl.c:51 [inline]
>>  __do_sys_ioctl fs/ioctl.c:870 [inline]
>>  __se_sys_ioctl fs/ioctl.c:856 [inline]
>>  __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
>>  do_syscall_x64 arch/x86/entry/common.c:50 [inline]
>>  do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
>>  entry_SYSCALL_64_after_hwframe+0x44/0xae
>> RIP: 0033:0x7fe7a4488ea7
>> RSP: 002b:00007ffcc64117a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
>> RAX: ffffffffffffffda RBX: 00007ffcc6411e68 RCX: 00007fe7a4488ea7
>> RDX: 0000000000000002 RSI: 00000000400448c9 RDI: 0000000000000003
>> RBP: 0000000000000003 R08: 00007fe7a3bff700 R09: 00007fe7a3bff700
>> R10: 00007fe7a3bff9d0 R11: 0000000000000246 R12: 0000000000000003
>> R13: 00007ffcc6411900 R14: 00007fe7a459c9b8 R15: 000000000000000c
>>  </TASK>
>>
>> Showing all locks held in the system:
>> 1 lock held by rcu_tasks_kthre/12:
>>  #0: ffffffff8bd84cd0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:502
>> 1 lock held by rcu_tasks_trace/13:
>>  #0: ffffffff8bd84950 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x26/0xc70 kernel/rcu/tasks.h:502
>> 1 lock held by khungtaskd/29:
>>  #0: ffffffff8bd85820 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6491
>> 2 locks held by getty/3356:
>>  #0: ffff88814bb09098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244
>>  #1: ffffc90002ce62e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xe50/0x13c0 drivers/tty/n_tty.c:2118
>> 3 locks held by kworker/u5:1/3691:
>>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>>  #0: ffff88802520a938 ((wq_completion)hci4){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>>  #1: ffffc90002f5fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>>  #2: ffff88801e529048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
>> 3 locks held by kworker/u5:2/3694:
>>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>>  #0: ffff88807eb0f138 ((wq_completion)hci1){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>>  #1: ffffc9000307fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>>  #2: ffff88801e165048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
>> 3 locks held by kworker/u5:3/3696:
>>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>>  #0: ffff88807ad37938 ((wq_completion)hci2){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>>  #1: ffffc9000309fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>>  #2: ffff88807d985048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
>> 3 locks held by kworker/u5:5/5430:
>>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
>>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
>>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
>>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
>>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
>>  #0: ffff88805b8c0938 ((wq_completion)hci0){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
>>  #1: ffffc90002e3fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
>>  #2: ffff888075741048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
>>
>> =============================================
>>
>> NMI backtrace for cpu 0
>> CPU: 0 PID: 29 Comm: khungtaskd Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
>> Call Trace:
>>  <TASK>
>>  __dump_stack lib/dump_stack.c:88 [inline]
>>  dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
>>  nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
>>  nmi_trigger_cpumask_backtrace+0x1e6/0x230 lib/nmi_backtrace.c:62
>>  trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
>>  check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
>>  watchdog+0xc22/0xf90 kernel/hung_task.c:378
>>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>>  </TASK>
>> Sending NMI from CPU 0 to CPUs 1:
>> NMI backtrace for cpu 1
>> CPU: 1 PID: 8 Comm: kworker/u4:0 Not tainted 5.18.0-rc5-next-20220502-syzkaller #0
>> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
>> Workqueue: events_unbound toggle_allocation_gate
>> RIP: 0010:__lock_acquire+0xd51/0x5660 kernel/locking/lockdep.c:5063
>> Code: 03 0f b6 04 02 84 c0 74 0d 3c 03 7f 09 48 8b 3c 24 e8 63 78 69 00 41 8b 85 58 0a 00 00 83 c0 01 83 f8 2f 41 89 85 58 0a 00 00 <0f> 87 eb 0b 00 00 3b 05 53 e2 1e 0e 41 be 01 00 00 00 0f 86 c8 00
>> RSP: 0018:ffffc900000d7748 EFLAGS: 00000097
>> RAX: 0000000000000006 RBX: ffffffff8f3c6c00 RCX: ffffffff815ddcee
>> RDX: 1ffff110021e1c5b RSI: 0000000000000001 RDI: ffffffff8f3c6c18
>> RBP: 000000000000f5e5 R08: 0000000000000000 R09: ffffffff9007b897
>> R10: fffffbfff200f712 R11: 0000000000000001 R12: ffff888010f0e3a8
>> R13: ffff888010f0d880 R14: 0000000000000000 R15: d4985ce4c67f0360
>> FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
>> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> CR2: 000000c001d7d000 CR3: 000000000ba8e000 CR4: 00000000003506e0
>> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
>> Call Trace:
>>  <TASK>
>>  lock_acquire kernel/locking/lockdep.c:5665 [inline]
>>  lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630
>>  __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline]
>>  _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
>>  spin_lock include/linux/spinlock.h:354 [inline]
>>  __get_locked_pte+0x154/0x270 mm/memory.c:1830
>>  get_locked_pte include/linux/mm.h:2127 [inline]
>>  __text_poke+0x1ae/0x8c0 arch/x86/kernel/alternative.c:1038
>>  text_poke arch/x86/kernel/alternative.c:1121 [inline]
>>  text_poke_bp_batch+0x433/0x6b0 arch/x86/kernel/alternative.c:1436
>>  text_poke_flush arch/x86/kernel/alternative.c:1542 [inline]
>>  text_poke_flush arch/x86/kernel/alternative.c:1539 [inline]
>>  text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1549
>>  arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146
>>  jump_label_update+0x32f/0x410 kernel/jump_label.c:830
>>  static_key_disable_cpuslocked+0x152/0x1b0 kernel/jump_label.c:207
>>  static_key_disable+0x16/0x20 kernel/jump_label.c:215
>>  toggle_allocation_gate mm/kfence/core.c:809 [inline]
>>  toggle_allocation_gate+0x183/0x390 mm/kfence/core.c:787
>>  process_one_work+0x996/0x1610 kernel/workqueue.c:2289
>>  worker_thread+0x665/0x1080 kernel/workqueue.c:2436
>>  kthread+0x2e9/0x3a0 kernel/kthread.c:376
>>  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
>>  </TASK>
>> ----------------
>> Code disassembly (best guess):
>>    0:	03 0f                	add    (%rdi),%ecx
>>    2:	b6 04                	mov    $0x4,%dh
>>    4:	02 84 c0 74 0d 3c 03 	add    0x33c0d74(%rax,%rax,8),%al
>>    b:	7f 09                	jg     0x16
>>    d:	48 8b 3c 24          	mov    (%rsp),%rdi
>>   11:	e8 63 78 69 00       	callq  0x697879
>>   16:	41 8b 85 58 0a 00 00 	mov    0xa58(%r13),%eax
>>   1d:	83 c0 01             	add    $0x1,%eax
>>   20:	83 f8 2f             	cmp    $0x2f,%eax
>>   23:	41 89 85 58 0a 00 00 	mov    %eax,0xa58(%r13)
>> * 2a:	0f 87 eb 0b 00 00    	ja     0xc1b <-- trapping instruction
>>   30:	3b 05 53 e2 1e 0e    	cmp    0xe1ee253(%rip),%eax        # 0xe1ee289
>>   36:	41 be 01 00 00 00    	mov    $0x1,%r14d
>>   3c:	0f                   	.byte 0xf
>>   3d:	86 c8                	xchg   %cl,%al
>>
>>
>> ---
>> This report is generated by a bot. It may contain errors.
>> See https://goo.gl/tpsmEJ for more information about syzbot.
>> syzbot engineers can be reached at syzkaller@googlegroups.com.
>>
>> syzbot will keep track of this issue. See:
>> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
>>
> 
> Given the call trace reported,
> 
> 	process_one_work
> 	  lock_map_acquire(&pwq->wq->lockdep_map);
> 	  lock_map_acquire(&lockdep_map);
> 	  hci_power_on
> 	    hci_dev_do_close
> 	      hci_req_sync_lock(hdev);
> 	      hci_dev_close_sync(hdev);
> 	        cancel_work_sync(&hdev->power_on);
> 		  __cancel_work_timer()
> 		    __flush_work(work, true);
> 			if (!from_cancel) {
> 				lock_map_acquire(&work->lockdep_map);
> 				lock_map_release(&work->lockdep_map);
> 			}
> 	      hci_req_sync_unlock(hdev);
> 
> 
> syzbot should have been able to catch cancel_work_sync() in work context
> by checking lockdep_map in __flush_work() for both flush and cancel.
> 
> Hillf
> 
> --- y/kernel/workqueue.c
> +++ x/kernel/workqueue.c
> @@ -3075,10 +3075,10 @@ static bool __flush_work(struct work_str
>  	if (WARN_ON(!work->func))
>  		return false;
>  
> -	if (!from_cancel) {
> +	//if (!from_cancel) {
>  		lock_map_acquire(&work->lockdep_map);
>  		lock_map_release(&work->lockdep_map);
> -	}
> +	//}
>  
>  	if (start_flush_work(work, &barr, from_cancel)) {
>  		wait_for_completion(&barr.done);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] INFO: task hung in hci_dev_close_sync
  2022-05-04  5:12   ` Tetsuo Handa
@ 2022-05-04  9:24     ` Johannes Berg
  2022-07-28 12:25       ` Tetsuo Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2022-05-04  9:24 UTC (permalink / raw)
  To: Tetsuo Handa, Tejun Heo
  Cc: linux-kernel, Dmitry Vyukov, syzkaller-bugs, Hillf Danton, syzbot

On Wed, 2022-05-04 at 05:12 +0000, Tetsuo Handa wrote:
> 
> This seems to be a question regarding commit 87915adc3f0acdf0 ("workqueue: re-add lockdep dependencies for flushing").
> > 
> > syzbot should have been able to catch cancel_work_sync() in work context
> > by checking lockdep_map in __flush_work() for both flush and cancel.
> > 
> > Hillf
> > 
> > --- y/kernel/workqueue.c
> > +++ x/kernel/workqueue.c
> > @@ -3075,10 +3075,10 @@ static bool __flush_work(struct work_str
> >       if (WARN_ON(!work->func))
> >               return false;
> > 
> > -     if (!from_cancel) {
> > +     //if (!from_cancel) {
> > 

I think this is explained in commit d6e89786bed9 ("workqueue: skip
lockdep wq dependency in cancel_work_sync()")

johannes

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] INFO: task hung in hci_dev_close_sync
  2022-05-03 16:59 [syzbot] INFO: task hung in hci_dev_close_sync syzbot
  2022-05-04  4:48 ` Hillf Danton
@ 2022-05-29  5:55 ` syzbot
  1 sibling, 0 replies; 7+ messages in thread
From: syzbot @ 2022-05-29  5:55 UTC (permalink / raw)
  To: davem, dvyukov, edumazet, hdanton, johan.hedberg, johannes.berg,
	johannes, kuba, linux-bluetooth, linux-kernel, linux-mm,
	luiz.dentz, marcel, netdev, pabeni, penguin-kernel,
	syzkaller-bugs, tj

syzbot has found a reproducer for the following issue on:

HEAD commit:    9d004b2f4fea Merge tag 'cxl-for-5.19' of git://git.kernel...
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=12fe6d23f00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=d5ef46f0e355ceff
dashboard link: https://syzkaller.appspot.com/bug?extid=c56f6371c48cad0420f9
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17c258f5f00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=144f1233f00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c56f6371c48cad0420f9@syzkaller.appspotmail.com

INFO: task kworker/u5:1:3610 blocked for more than 143 seconds.
      Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:1    state:D stack:27304 pid: 3610 ppid:     2 flags:0x00004000
Workqueue: hci9 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5116 [inline]
 __schedule+0xa00/0x4b30 kernel/sched/core.c:6431
 schedule+0xd2/0x1f0 kernel/sched/core.c:6503
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1911
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3075
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3162
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4091
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
 </TASK>
INFO: task kworker/u5:3:3617 blocked for more than 144 seconds.
      Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:3    state:D stack:27568 pid: 3617 ppid:     2 flags:0x00004000
Workqueue: hci8 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5116 [inline]
 __schedule+0xa00/0x4b30 kernel/sched/core.c:6431
 schedule+0xd2/0x1f0 kernel/sched/core.c:6503
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1911
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3075
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3162
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4091
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
 </TASK>
INFO: task kworker/u5:4:3619 blocked for more than 144 seconds.
      Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u5:4    state:D stack:27192 pid: 3619 ppid:     2 flags:0x00004000
Workqueue: hci7 hci_power_on
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5116 [inline]
 __schedule+0xa00/0x4b30 kernel/sched/core.c:6431
 schedule+0xd2/0x1f0 kernel/sched/core.c:6503
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1911
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 __flush_work+0x56c/0xb10 kernel/workqueue.c:3075
 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3162
 hci_dev_close_sync+0x8d/0x1150 net/bluetooth/hci_sync.c:4091
 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553
 hci_power_on+0x1c0/0x630 net/bluetooth/hci_core.c:981
 process_one_work+0x996/0x1610 kernel/workqueue.c:2289
 worker_thread+0x665/0x1080 kernel/workqueue.c:2436
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
 </TASK>
INFO: task syz-executor921:3700 blocked for more than 145 seconds.
      Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor921 state:D stack:27944 pid: 3700 ppid:  3603 flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5116 [inline]
 __schedule+0xa00/0x4b30 kernel/sched/core.c:6431
 schedule+0xd2/0x1f0 kernel/sched/core.c:6503
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1911
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x3ed/0x13a0 kernel/workqueue.c:2861
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1169
 sock_ioctl+0x2f1/0x640 net/socket.c:1286
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f595e7f37e7
RSP: 002b:00007ffc76721138 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f595e7f37e7
RDX: 0000000000000009 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000004 R08: 00007f595e7a0700 R09: 00007f595e7a0700
R10: 00007f595e7a09d0 R11: 0000000000000246 R12: 6c616b7a79732f2e
R13: 585858582e72656c R14: 00007ffc76721164 R15: 00007ffc767211a0
 </TASK>
INFO: task syz-executor921:3701 blocked for more than 145 seconds.
      Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor921 state:D stack:27944 pid: 3701 ppid:  3603 flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5116 [inline]
 __schedule+0xa00/0x4b30 kernel/sched/core.c:6431
 schedule+0xd2/0x1f0 kernel/sched/core.c:6503
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1911
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x3ed/0x13a0 kernel/workqueue.c:2861
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1169
 sock_ioctl+0x2f1/0x640 net/socket.c:1286
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f595e7f37e7
RSP: 002b:00007ffc76721138 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f595e7f37e7
RDX: 0000000000000007 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000004 R08: 00007f595e7a0700 R09: 00007f595e7a0700
R10: 00007f595e7a09d0 R11: 0000000000000246 R12: 6c616b7a79732f2e
R13: 585858582e72656c R14: 00007ffc76721164 R15: 00007ffc767211a0
 </TASK>
INFO: task syz-executor921:3702 blocked for more than 145 seconds.
      Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor921 state:D stack:26648 pid: 3702 ppid:  3603 flags:0x00004000
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5116 [inline]
 __schedule+0xa00/0x4b30 kernel/sched/core.c:6431
 schedule+0xd2/0x1f0 kernel/sched/core.c:6503
 schedule_timeout+0x1db/0x2a0 kernel/time/timer.c:1911
 do_wait_for_common kernel/sched/completion.c:85 [inline]
 __wait_for_common+0x378/0x530 kernel/sched/completion.c:106
 flush_workqueue+0x3ed/0x13a0 kernel/workqueue.c:2861
 hci_dev_open+0xdb/0x300 net/bluetooth/hci_core.c:526
 hci_sock_ioctl+0x62c/0x910 net/bluetooth/hci_sock.c:1027
 sock_do_ioctl+0xcc/0x230 net/socket.c:1169
 sock_ioctl+0x2f1/0x640 net/socket.c:1286
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x7f595e7f37e7
RSP: 002b:00007ffc76721138 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f595e7f37e7
RDX: 0000000000000008 RSI: 00000000400448c9 RDI: 0000000000000003
RBP: 0000000000000004 R08: 00007f595e7a0700 R09: 00007f595e7a0700
R10: 00007f595e7a09d0 R11: 0000000000000246 R12: 6c616b7a79732f2e
R13: 585858582e72656c R14: 00007ffc76721164 R15: 00007ffc767211a0
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/29:
 #0: ffffffff8bd86860 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 kernel/locking/lockdep.c:6491
2 locks held by getty/3285:
 #0: ffff88814c09b098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x22/0x80 drivers/tty/tty_ldisc.c:244
 #1: ffffc90002cd62e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xcea/0x1230 drivers/tty/n_tty.c:2075
2 locks held by sshd/3597:
3 locks held by kworker/u5:1/3610:
 #0: ffff88807898c138 ((wq_completion)hci9){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff88807898c138 ((wq_completion)hci9){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff88807898c138 ((wq_completion)hci9){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff88807898c138 ((wq_completion)hci9){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff88807898c138 ((wq_completion)hci9){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff88807898c138 ((wq_completion)hci9){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc9000302fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff88801a3f9048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
3 locks held by kworker/u5:3/3617:
 #0: ffff888076411138 ((wq_completion)hci8){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888076411138 ((wq_completion)hci8){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff888076411138 ((wq_completion)hci8){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff888076411138 ((wq_completion)hci8){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff888076411138 ((wq_completion)hci8){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff888076411138 ((wq_completion)hci8){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc9000312fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff88807421d048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551
3 locks held by kworker/u5:4/3619:
 #0: ffff888076414138 ((wq_completion)hci7){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline]
 #0: ffff888076414138 ((wq_completion)hci7){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline]
 #0: ffff888076414138 ((wq_completion)hci7){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline]
 #0: ffff888076414138 ((wq_completion)hci7){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline]
 #0: ffff888076414138 ((wq_completion)hci7){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline]
 #0: ffff888076414138 ((wq_completion)hci7){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260
 #1: ffffc9000315fda8 ((work_completion)(&hdev->power_on)){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264
 #2: ffff888074219048 (&hdev->req_lock){+.+.}-{3:3}, at: hci_dev_do_close+0x2a/0x70 net/bluetooth/hci_core.c:551

=============================================

NMI backtrace for cpu 1
CPU: 1 PID: 29 Comm: khungtaskd Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x1e6/0x230 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
 watchdog+0xc22/0xf90 kernel/hung_task.c:378
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 3599 Comm: strace-static-x Not tainted 5.18.0-syzkaller-10643-g9d004b2f4fea #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:129 [inline]
RIP: 0010:memory_is_poisoned mm/kasan/generic.c:159 [inline]
RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline]
RIP: 0010:kasan_check_range+0x55/0x180 mm/kasan/generic.c:189
Code: 86 05 01 00 00 49 83 e9 01 48 89 fd 48 b8 00 00 00 00 00 fc ff df 4d 89 ca 48 c1 ed 03 49 c1 ea 03 48 01 c5 49 01 c2 48 89 e8 <49> 8d 5a 01 48 89 da 48 29 ea 48 83 fa 10 7e 63 41 89 eb 41 83 e3
RSP: 0018:ffffc90002eff9c8 EFLAGS: 00000082
RAX: fffffbfff1b77492 RBX: 0000000000000000 RCX: ffffffff815e5141
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffffff8dbba490
RBP: fffffbfff1b77492 R08: 0000000000000000 R09: ffffffff8dbba497
R10: fffffbfff1b77492 R11: 0000000000000000 R12: ffff8880b9c39ed8
R13: ffff8880b9c39ec0 R14: ffff88802525a298 R15: ffff888025259d80
FS:  0000000000757340(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555566c1608 CR3: 0000000073fd2000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 instrument_atomic_read include/linux/instrumented.h:71 [inline]
 test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
 cpumask_test_cpu include/linux/cpumask.h:379 [inline]
 cpu_online include/linux/cpumask.h:921 [inline]
 trace_lock_release include/trace/events/lock.h:69 [inline]
 lock_release+0xa1/0x780 kernel/locking/lockdep.c:5676
 prepare_lock_switch kernel/sched/core.c:4860 [inline]
 context_switch kernel/sched/core.c:5113 [inline]
 __schedule+0x9cd/0x4b30 kernel/sched/core.c:6431
 preempt_schedule_common+0x45/0xc0 kernel/sched/core.c:6596
 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:35
 try_to_wake_up+0xa04/0x1800 kernel/sched/core.c:4201
 ptrace_resume+0x27d/0x2d0 kernel/ptrace.c:895
 ptrace_request+0x180/0xef0 kernel/ptrace.c:1230
 arch_ptrace+0x36/0x510 arch/x86/kernel/ptrace.c:828
 __do_sys_ptrace kernel/ptrace.c:1321 [inline]
 __se_sys_ptrace kernel/ptrace.c:1286 [inline]
 __x64_sys_ptrace+0x178/0x310 kernel/ptrace.c:1286
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x46/0xb0
RIP: 0033:0x4e6c1a
Code: Unable to access opcode bytes at RIP 0x4e6bf0.
RSP: 002b:00007ffdb7543730 EFLAGS: 00000206 ORIG_RAX: 0000000000000065
RAX: ffffffffffffffda RBX: 00000000007572f8 RCX: 00000000004e6c1a
RDX: 0000000000000000 RSI: 0000000000000e2e RDI: 0000000000000018
RBP: 0000000000000018 R08: 0000000000000017 R09: 0000000000000002
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000759380
R13: 0000000000000000 R14: 000000000000857f R15: 0000000000617180
 </TASK>
INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 1.132 msecs
----------------
Code disassembly (best guess):
   0:	86 05 01 00 00 49    	xchg   %al,0x49000001(%rip)        # 0x49000007
   6:	83 e9 01             	sub    $0x1,%ecx
   9:	48 89 fd             	mov    %rdi,%rbp
   c:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  13:	fc ff df
  16:	4d 89 ca             	mov    %r9,%r10
  19:	48 c1 ed 03          	shr    $0x3,%rbp
  1d:	49 c1 ea 03          	shr    $0x3,%r10
  21:	48 01 c5             	add    %rax,%rbp
  24:	49 01 c2             	add    %rax,%r10
  27:	48 89 e8             	mov    %rbp,%rax
* 2a:	49 8d 5a 01          	lea    0x1(%r10),%rbx <-- trapping instruction
  2e:	48 89 da             	mov    %rbx,%rdx
  31:	48 29 ea             	sub    %rbp,%rdx
  34:	48 83 fa 10          	cmp    $0x10,%rdx
  38:	7e 63                	jle    0x9d
  3a:	41 89 eb             	mov    %ebp,%r11d
  3d:	41                   	rex.B
  3e:	83                   	.byte 0x83
  3f:	e3                   	.byte 0xe3


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] INFO: task hung in hci_dev_close_sync
  2022-05-04  9:24     ` Johannes Berg
@ 2022-07-28 12:25       ` Tetsuo Handa
  0 siblings, 0 replies; 7+ messages in thread
From: Tetsuo Handa @ 2022-07-28 12:25 UTC (permalink / raw)
  To: Johannes Berg, Tejun Heo
  Cc: linux-kernel, Dmitry Vyukov, syzkaller-bugs, Hillf Danton, syzbot

On 2022/05/04 18:24, Johannes Berg wrote:
> On Wed, 2022-05-04 at 05:12 +0000, Tetsuo Handa wrote:
>>
>> This seems to be a question regarding commit 87915adc3f0acdf0 ("workqueue: re-add lockdep dependencies for flushing").
>>>
>>> syzbot should have been able to catch cancel_work_sync() in work context
>>> by checking lockdep_map in __flush_work() for both flush and cancel.
>>>
>>> Hillf
>>>
>>> --- y/kernel/workqueue.c
>>> +++ x/kernel/workqueue.c
>>> @@ -3075,10 +3075,10 @@ static bool __flush_work(struct work_str
>>>       if (WARN_ON(!work->func))
>>>               return false;
>>>
>>> -     if (!from_cancel) {
>>> +     //if (!from_cancel) {
>>>
> 
> I think this is explained in commit d6e89786bed9 ("workqueue: skip
> lockdep wq dependency in cancel_work_sync()")

I couldn't agree on that reasoning, and I sent
https://lkml.kernel.org/r/21b9c1ac-64b7-7f4b-1e62-bf2f021fffcd@I-love.SAKURA.ne.jp .

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [syzbot] INFO: task hung in hci_dev_close_sync
       [not found] <20220529093522.4155-1-hdanton@sina.com>
@ 2022-05-29  9:58 ` syzbot
  0 siblings, 0 replies; 7+ messages in thread
From: syzbot @ 2022-05-29  9:58 UTC (permalink / raw)
  To: hdanton, linux-kernel, syzkaller-bugs

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+c56f6371c48cad0420f9@syzkaller.appspotmail.com

Tested on:

commit:         9d004b2f Merge tag 'cxl-for-5.19' of git://git.kernel...
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel config:  https://syzkaller.appspot.com/x/.config?x=d5ef46f0e355ceff
dashboard link: https://syzkaller.appspot.com/bug?extid=c56f6371c48cad0420f9
compiler:       gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch:          https://syzkaller.appspot.com/x/patch.diff?x=15816d23f00000

Note: testing is done by a robot and is best-effort only.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-28 12:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-03 16:59 [syzbot] INFO: task hung in hci_dev_close_sync syzbot
2022-05-04  4:48 ` Hillf Danton
2022-05-04  5:12   ` Tetsuo Handa
2022-05-04  9:24     ` Johannes Berg
2022-07-28 12:25       ` Tetsuo Handa
2022-05-29  5:55 ` syzbot
     [not found] <20220529093522.4155-1-hdanton@sina.com>
2022-05-29  9:58 ` syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.