BUG: sleeping function called from invalid context at kernel/workqueue.c:3028 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 25, name: kworker/1:1 preempt_count: 101, expected: 0 RCU nest depth: 0, expected: 0 6 locks held by kworker/1:1/25: #0: ffff888011fab138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888011fab138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888011fab138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888011fab138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:631 [inline] #0: ffff888011fab138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:658 [inline] #0: ffff888011fab138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x890/0x1680 kernel/workqueue.c:2278 #1: ffffc90000dffdb0 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x8c4/0x1680 kernel/workqueue.c:2282 #2: ffff88801dcd6220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:767 [inline] #2: ffff88801dcd6220 (&dev->mutex){....}-{3:3}, at: hub_event+0x1c5/0x44d0 drivers/usb/core/hub.c:5688 #3: ffff88802c541220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:767 [inline] #3: ffff88802c541220 (&dev->mutex){....}-{3:3}, at: usb_disconnect.cold+0x43/0x78e drivers/usb/core/hub.c:2219 #4: ffff888010c67948 (&root->kernfs_rwsem){++++}-{3:3}, at: kernfs_drain fs/kernfs/dir.c:486 [inline] #4: ffff888010c67948 (&root->kernfs_rwsem){++++}-{3:3}, at: __kernfs_remove+0x5fc/0xb20 fs/kernfs/dir.c:1367 #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: 130863 hardirqs last enabled at (130862): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (130862): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (130863): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (130863): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (130462): [] spin_unlock_bh include/linux/spinlock.h:399 [inline] softirqs last enabled at (130462): [] nsim_dev_trap_report drivers/net/netdevsim/dev.c:817 [inline] softirqs last enabled at (130462): [] nsim_dev_trap_report_work+0x855/0xbc0 drivers/net/netdevsim/dev.c:843 softirqs last disabled at (130855): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (130855): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 Preemption disabled at: [] unwind_next_frame+0x120/0x1ce0 arch/x86/kernel/unwind_orc.c:428 CPU: 1 PID: 25 Comm: kworker/1:1 Not tainted 5.16.0-rc5-next-20211220-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:3028 [inline] __flush_work+0x109/0xb10 kernel/workqueue.c:3092 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3180 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:975 __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:orc_find arch/x86/kernel/unwind_orc.c:173 [inline] RIP: 0010:unwind_next_frame+0x315/0x1ce0 arch/x86/kernel/unwind_orc.c:443 Code: c2 01 49 81 f8 6e c8 ac 8e 0f 83 75 09 00 00 89 d7 48 8d 3c 7f 48 8d bc 3f 20 33 09 8e 48 81 ff 6e c8 ac 8e 0f 87 5a 09 00 00 <48> 8d 3c 85 ec 24 9c 8d 29 ca 4c 89 c6 4c 89 f9 e8 96 f5 ff ff 49 RSP: 0018:ffffc90000dff128 EFLAGS: 00000297 RAX: 000000000002d237 RBX: 1ffff920001bfe2d RCX: 000000000002d237 RDX: 000000000002d243 RSI: 000000000000c259 RDI: ffffffff8e1a20b2 RBP: 0000000000000001 R08: ffffffff8e1a206a R09: 0000000000000001 R10: fffff520001bfe4b R11: 0000000000088077 R12: ffffc90000dff248 R13: ffffc90000dff235 R14: ffffc90000dff200 R15: ffffffff81c259da arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kmem_cache_free+0xdd/0x580 mm/slub.c:3527 kernfs_put.part.0+0x2c4/0x540 fs/kernfs/dir.c:539 kernfs_put+0x42/0x50 fs/kernfs/dir.c:513 __kernfs_remove+0x7a3/0xb20 fs/kernfs/dir.c:1388 kernfs_remove_by_name_ns+0xa8/0x110 fs/kernfs/dir.c:1565 kernfs_remove_by_name include/linux/kernfs.h:572 [inline] remove_files+0x96/0x1c0 fs/sysfs/group.c:28 sysfs_remove_group+0x87/0x170 fs/sysfs/group.c:288 sysfs_remove_groups fs/sysfs/group.c:312 [inline] sysfs_remove_groups+0x5c/0xa0 fs/sysfs/group.c:304 device_remove_groups drivers/base/core.c:2480 [inline] device_remove_attrs+0xcb/0x170 drivers/base/core.c:2680 device_del+0x4fa/0xd50 drivers/base/core.c:3576 device_unregister+0x1f/0xc0 drivers/base/core.c:3609 usb_remove_ep_devs+0x3e/0x80 drivers/usb/core/endpoint.c:188 remove_intf_ep_devs drivers/usb/core/message.c:1267 [inline] usb_disable_device+0x306/0x7b0 drivers/usb/core/message.c:1418 usb_disconnect.cold+0x27a/0x78e drivers/usb/core/hub.c:2228 hub_port_connect drivers/usb/core/hub.c:5202 [inline] hub_port_connect_change drivers/usb/core/hub.c:5502 [inline] port_event drivers/usb/core/hub.c:5660 [inline] hub_event+0x1e39/0x44d0 drivers/usb/core/hub.c:5742 process_one_work+0x9ac/0x1680 kernel/workqueue.c:2307 worker_thread+0x652/0x11c0 kernel/workqueue.c:2454 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:3028 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 4420, name: kworker/u4:18 preempt_count: 100, expected: 0 RCU nest depth: 1, expected: 0 5 locks held by kworker/u4:18/4420: #0: ffff8881407fb138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff8881407fb138 ((wq_completion)netns){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff8881407fb138 ((wq_completion)netns){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff8881407fb138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:631 [inline] #0: ffff8881407fb138 ((wq_completion)netns){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:658 [inline] #0: ffff8881407fb138 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x890/0x1680 kernel/workqueue.c:2278 #1: ffffc9000560fdb0 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x8c4/0x1680 kernel/workqueue.c:2282 #2: ffffffff8d311610 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x9b/0xb00 net/core/net_namespace.c:557 #3: ffffffff8bb82560 (rcu_read_lock){....}-{1:2}, at: inet_twsk_purge+0xd0/0x7d0 net/ipv4/inet_timewait_sock.c:270 #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: 679549 hardirqs last enabled at (679548): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (679548): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (679549): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (679549): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (679530): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (679530): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 softirqs last disabled at (679539): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (679539): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 Preemption disabled at: [] softirq_handle_begin kernel/softirq.c:396 [inline] [] __do_softirq+0xe1/0x9c2 kernel/softirq.c:534 CPU: 1 PID: 4420 Comm: kworker/u4:18 Tainted: G W 5.16.0-rc5-next-20211220-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net 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:3028 [inline] __flush_work+0x109/0xb10 kernel/workqueue.c:3092 __cancel_work_timer+0x3f9/0x570 kernel/workqueue.c:3180 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:975 __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:lock_acquire+0x1ef/0x510 kernel/locking/lockdep.c:5607 Code: 87 a5 7e 83 f8 01 0f 85 b4 02 00 00 9c 58 f6 c4 02 0f 85 9f 02 00 00 48 83 7c 24 08 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c3 48 c7 03 00 00 00 00 48 c7 43 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffffc9000560fa58 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 1ffff92000ac1f4d RCX: def1027075e99fe2 RDX: 1ffff11005f71c44 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ffaf947 R10: fffffbfff1ff5f28 R11: 0000000000000000 R12: 0000000000000002 R13: 0000000000000000 R14: ffffffff8bb82560 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:268 [inline] rcu_read_lock include/linux/rcupdate.h:694 [inline] inet_twsk_purge+0x117/0x7d0 net/ipv4/inet_timewait_sock.c:268 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:595 process_one_work+0x9ac/0x1680 kernel/workqueue.c:2307 worker_thread+0x652/0x11c0 kernel/workqueue.c:2454 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 ---------------- Code disassembly (best guess): 0: c2 01 49 retq $0x4901 3: 81 f8 6e c8 ac 8e cmp $0x8eacc86e,%eax 9: 0f 83 75 09 00 00 jae 0x984 f: 89 d7 mov %edx,%edi 11: 48 8d 3c 7f lea (%rdi,%rdi,2),%rdi 15: 48 8d bc 3f 20 33 09 lea -0x71f6cce0(%rdi,%rdi,1),%rdi 1c: 8e 1d: 48 81 ff 6e c8 ac 8e cmp $0xffffffff8eacc86e,%rdi 24: 0f 87 5a 09 00 00 ja 0x984 * 2a: 48 8d 3c 85 ec 24 9c lea -0x7263db14(,%rax,4),%rdi <-- trapping instruction 31: 8d 32: 29 ca sub %ecx,%edx 34: 4c 89 c6 mov %r8,%rsi 37: 4c 89 f9 mov %r15,%rcx 3a: e8 96 f5 ff ff callq 0xfffff5d5 3f: 49 rex.WB