BUG: sleeping function called from invalid context at kernel/workqueue.c:3039 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 28200, name: kworker/1:7 preempt_count: 101, expected: 0 RCU nest depth: 0, expected: 0 5 locks held by kworker/1:7/28200: #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2289 #1: ffffc90004c67db0 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2293 #2: ffff888147c5d220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:760 [inline] #2: ffff888147c5d220 (&dev->mutex){....}-{3:3}, at: hub_event+0x1c1/0x4460 drivers/usb/core/hub.c:5671 #3: ffffffff8bb71620 (console_lock){+.+.}-{0:0}, at: dev_vprintk_emit+0x36e/0x3b2 drivers/base/core.c:4593 #4: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline] #4: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1411 irq event stamp: 3964387 hardirqs last enabled at (3964386): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (3964386): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (3964387): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (3964387): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (3951600): [] spin_unlock_bh include/linux/spinlock.h:399 [inline] softirqs last enabled at (3951600): [] nsim_dev_trap_report drivers/net/netdevsim/dev.c:817 [inline] softirqs last enabled at (3951600): [] nsim_dev_trap_report_work+0x855/0xbc0 drivers/net/netdevsim/dev.c:843 softirqs last disabled at (3964379): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (3964379): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 Preemption disabled at: [] vprintk_emit+0x13d/0x4f0 kernel/printk/printk.c:2241 CPU: 1 PID: 28200 Comm: kworker/1:7 Not tainted 5.16.0-rc4-next-20211208-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9583 start_flush_work kernel/workqueue.c:3039 [inline] __flush_work+0x109/0xb10 kernel/workqueue.c:3103 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3191 hci_cmd_sync_cancel net/bluetooth/hci_sync.c:346 [inline] hci_cmd_sync_cancel+0xe1/0x170 net/bluetooth/hci_sync.c:338 btusb_intr_complete+0x3d3/0x4a0 drivers/bluetooth/btusb.c:969 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726 dummy_timer+0x11f9/0x32b0 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:preempt_count arch/x86/include/asm/preempt.h:27 [inline] RIP: 0010:check_kcov_mode kernel/kcov.c:166 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:200 Code: 48 89 ef 5d e9 d1 9c 4a 00 5d be 03 00 00 00 e9 d6 ae 6f 02 66 0f 1f 44 00 00 48 8b be b0 01 00 00 e8 b4 ff ff ff 31 c0 c3 90 <65> 8b 05 a9 8c 8a 7e 89 c1 48 8b 34 24 81 e1 00 01 00 00 65 48 8b RSP: 0018:ffffc90004c675b8 EFLAGS: 00000212 RAX: 0000000000002b5f RBX: 0000000000000000 RCX: ffffc90010879000 RDX: 0000000000040000 RSI: ffffffff815efdcc RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ff9e947 R10: ffffffff815efdc2 R11: 0000000000000000 R12: ffffffff84e16300 R13: 0000000000000200 R14: ffffc90004c67618 R15: dffffc0000000000 console_unlock+0x6c2/0xb70 kernel/printk/printk.c:2719 vprintk_emit+0x198/0x4f0 kernel/printk/printk.c:2248 dev_vprintk_emit+0x36e/0x3b2 drivers/base/core.c:4593 dev_printk_emit+0xba/0xf1 drivers/base/core.c:4604 __dev_printk+0xcf/0xf5 drivers/base/core.c:4616 _dev_info+0xd7/0x109 drivers/base/core.c:4662 usb_disconnect.cold+0x25/0x78e drivers/usb/core/hub.c:2207 hub_port_connect drivers/usb/core/hub.c:5197 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5643 [inline] hub_event+0x1c9c/0x4460 drivers/usb/core/hub.c:5725 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2318 worker_thread+0x658/0x11f0 kernel/workqueue.c:2465 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 BUG: sleeping function called from invalid context at kernel/workqueue.c:3039 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 8518, name: kworker/1:6 preempt_count: 101, expected: 0 RCU nest depth: 0, expected: 0 6 locks held by kworker/1:6/8518: #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline] #0: ffff888141dddd38 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2289 #1: ffffc9000fac7db0 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2293 #2: ffff888147c5d220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:760 [inline] #2: ffff888147c5d220 (&dev->mutex){....}-{3:3}, at: hub_event+0x1c1/0x4460 drivers/usb/core/hub.c:5671 #3: ffff88801d36a220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:760 [inline] #3: ffff88801d36a220 (&dev->mutex){....}-{3:3}, at: usb_disconnect.cold+0x43/0x78e drivers/usb/core/hub.c:2216 #4: ffff8880349a21a8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:760 [inline] #4: ffff8880349a21a8 (&dev->mutex){....}-{3:3}, at: __device_driver_lock drivers/base/dd.c:1032 [inline] #4: ffff8880349a21a8 (&dev->mutex){....}-{3:3}, at: device_release_driver_internal drivers/base/dd.c:1233 [inline] #4: ffff8880349a21a8 (&dev->mutex){....}-{3:3}, at: device_release_driver+0x1c/0x40 drivers/base/dd.c:1259 #5: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline] #5: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1411 irq event stamp: 3268423 hardirqs last enabled at (3268422): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (3268422): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (3268423): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (3268423): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (3268040): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (3268040): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 softirqs last disabled at (3268419): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (3268419): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 8518 Comm: kworker/1:6 Tainted: G W 5.16.0-rc4-next-20211208-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9583 start_flush_work kernel/workqueue.c:3039 [inline] __flush_work+0x109/0xb10 kernel/workqueue.c:3103 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3191 hci_cmd_sync_cancel net/bluetooth/hci_sync.c:346 [inline] hci_cmd_sync_cancel+0xe1/0x170 net/bluetooth/hci_sync.c:338 btusb_intr_complete+0x3d3/0x4a0 drivers/bluetooth/btusb.c:969 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726 dummy_timer+0x11f9/0x32b0 drivers/usb/gadget/udc/dummy_hcd.c:1987 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 3a 28 06 f8 48 89 ef e8 82 9e 06 f8 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 03 57 f9 f7 65 8b 05 2c c4 ab 76 85 c0 74 0a 5b 5d c3 e8 90 80 RSP: 0018:ffffc9000fac7558 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff1ff8fee RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff888147c38000 R08: 0000000000000001 R09: ffffffff8ff9e9af R10: 0000000000000001 R11: 0000000000000000 R12: 00000000fffffff0 R13: 00000000fffffffe R14: ffff888147c5b3c8 R15: 00000000fffffffe spin_unlock_irqrestore include/linux/spinlock.h:409 [inline] dummy_urb_dequeue+0x142/0x190 drivers/usb/gadget/udc/dummy_hcd.c:1328 unlink1+0xc0/0x510 drivers/usb/core/hcd.c:1585 usb_hcd_unlink_urb+0x130/0x200 drivers/usb/core/hcd.c:1616 usb_kill_urb.part.0+0xa3/0x220 drivers/usb/core/urb.c:719 usb_kill_urb+0x7f/0xa0 drivers/usb/core/urb.c:715 usb_hcd_flush_endpoint+0x35b/0x410 drivers/usb/core/hcd.c:1810 usb_disable_endpoint drivers/usb/core/message.c:1303 [inline] usb_disable_interface+0x327/0x3c0 drivers/usb/core/message.c:1349 usb_unbind_interface+0x3d2/0x8e0 drivers/usb/core/driver.c:456 __device_release_driver+0x5d7/0x700 drivers/base/dd.c:1205 device_release_driver_internal drivers/base/dd.c:1236 [inline] device_release_driver+0x26/0x40 drivers/base/dd.c:1259 bus_remove_device+0x2eb/0x5a0 drivers/base/bus.c:529 device_del+0x502/0xd50 drivers/base/core.c:3581 usb_disable_device+0x35b/0x7b0 drivers/usb/core/message.c:1419 usb_disconnect.cold+0x27a/0x78e drivers/usb/core/hub.c:2225 hub_port_connect drivers/usb/core/hub.c:5197 [inline] hub_port_connect_change drivers/usb/core/hub.c:5497 [inline] port_event drivers/usb/core/hub.c:5643 [inline] hub_event+0x1c9c/0x4460 drivers/usb/core/hub.c:5725 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2318 worker_thread+0x658/0x11f0 kernel/workqueue.c:2465 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 ---------------- Code disassembly (best guess): 0: 48 89 ef mov %rbp,%rdi 3: 5d pop %rbp 4: e9 d1 9c 4a 00 jmpq 0x4a9cda 9: 5d pop %rbp a: be 03 00 00 00 mov $0x3,%esi f: e9 d6 ae 6f 02 jmpq 0x26faeea 14: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) 1a: 48 8b be b0 01 00 00 mov 0x1b0(%rsi),%rdi 21: e8 b4 ff ff ff callq 0xffffffda 26: 31 c0 xor %eax,%eax 28: c3 retq 29: 90 nop * 2a: 65 8b 05 a9 8c 8a 7e mov %gs:0x7e8a8ca9(%rip),%eax # 0x7e8a8cda <-- trapping instruction 31: 89 c1 mov %eax,%ecx 33: 48 8b 34 24 mov (%rsp),%rsi 37: 81 e1 00 01 00 00 and $0x100,%ecx 3d: 65 gs 3e: 48 rex.W 3f: 8b .byte 0x8b