BUG: sleeping function called from invalid context at kernel/workqueue.c:3039 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 2973, name: systemd-udevd preempt_count: 102, expected: 0 RCU nest depth: 0, expected: 0 2 locks held by systemd-udevd/2973: #0: ffffffff8c3628d8 (tomoyo_ss){....}-{0:0}, at: tomoyo_path_perm+0x1c1/0x400 security/tomoyo/file.c:847 #1: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline] #1: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1411 irq event stamp: 2099723 hardirqs last enabled at (2099722): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (2099722): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (2099723): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (2099723): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (2099072): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (2099072): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 softirqs last disabled at (2099709): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (2099709): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 Preemption disabled at: [] is_module_text_address+0x10/0x50 kernel/module.c:4751 CPU: 1 PID: 2973 Comm: systemd-udevd Not tainted 5.16.0-rc4-next-20211208-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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:rcu_lockdep_current_cpu_online kernel/rcu/tree.c:1176 [inline] RIP: 0010:rcu_lockdep_current_cpu_online+0x28/0x150 kernel/rcu/tree.c:1167 Code: 00 90 65 8b 15 d9 0b 9f 7e 81 e2 00 00 f0 00 b8 01 00 00 00 75 0a 8b 15 56 03 2f 0c 85 d2 75 01 c3 55 53 65 ff 05 b8 0b 9f 7e 03 5d f0 07 48 c7 c3 80 ab 03 00 83 f8 07 89 c5 0f 87 f5 00 00 RSP: 0018:ffffc9000203f9e0 EFLAGS: 00000282 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000002000 RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffffffff8b5798a8 RBP: ffff888010c42140 R08: 0000000000000c40 R09: ffff888037764000 R10: 0000000000000001 R11: 00000000ffffffff R12: 0000000000000001 R13: ffff888037764000 R14: 0000000000001000 R15: 0000000000000c40 rcu_read_lock_held_common kernel/rcu/update.c:112 [inline] rcu_read_lock_held_common kernel/rcu/update.c:102 [inline] rcu_read_lock_sched_held+0x25/0x70 kernel/rcu/update.c:123 trace_kmalloc include/trace/events/kmem.h:46 [inline] trace_kmalloc+0x32/0xf0 include/trace/events/kmem.h:46 __kmalloc+0x184/0x340 mm/slub.c:4421 kmalloc include/linux/slab.h:586 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 security_inode_getattr+0xcf/0x140 security/security.c:1326 vfs_getattr fs/stat.c:157 [inline] vfs_statx+0x164/0x390 fs/stat.c:225 vfs_fstatat fs/stat.c:243 [inline] vfs_lstat include/linux/fs.h:3292 [inline] __do_sys_newlstat+0x91/0x110 fs/stat.c:398 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:0x7f01ff6fc335 Code: 69 db 2b 00 64 c7 00 16 00 00 00 b8 ff ff ff ff c3 0f 1f 40 00 83 ff 01 48 89 f0 77 30 48 89 c7 48 89 d6 b8 06 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 03 f3 c3 90 48 8b 15 31 db 2b 00 f7 d8 64 89 RSP: 002b:00007ffc198e7dd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000006 RAX: ffffffffffffffda RBX: 000056243ca70ca0 RCX: 00007f01ff6fc335 RDX: 00007ffc198e7e10 RSI: 00007ffc198e7e10 RDI: 000056243ca6fca0 RBP: 00007ffc198e7ed0 R08: 00007f01ff9bb218 R09: 0000000000001010 R10: 00007f01ff9bab58 R11: 0000000000000246 R12: 000056243ca6fca0 R13: 000056243ca6fcac R14: 000056243ca58e55 R15: 000056243ca58e5c BUG: sleeping function called from invalid context at kernel/workqueue.c:3039 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 2980, name: kworker/1:3 preempt_count: 100, expected: 0 RCU nest depth: 0, expected: 0 5 locks held by kworker/1:3/2980: #0: ffff888141b87138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888141b87138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888141b87138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888141b87138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:635 [inline] #0: ffff888141b87138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:662 [inline] #0: ffff888141b87138 ((wq_completion)usb_hub_wq){+.+.}-{0:0}, at: process_one_work+0x896/0x1690 kernel/workqueue.c:2289 #1: ffffc90001abfdb0 ((work_completion)(&hub->events)){+.+.}-{0:0}, at: process_one_work+0x8ca/0x1690 kernel/workqueue.c:2293 #2: ffff88801d784220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:760 [inline] #2: ffff88801d784220 (&dev->mutex){....}-{3:3}, at: hub_event+0x1c1/0x4460 drivers/usb/core/hub.c:5671 #3: ffff888033610220 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:760 [inline] #3: ffff888033610220 (&dev->mutex){....}-{3:3}, at: usb_disconnect.cold+0x43/0x78e drivers/usb/core/hub.c:2216 #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: 289475 hardirqs last enabled at (289474): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (289474): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (289475): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (289475): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (289364): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last enabled at (289364): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 softirqs last disabled at (289471): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (289471): [] __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: 2980 Comm: kworker/1:3 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:lock_release+0x3f1/0x720 kernel/locking/lockdep.c:5647 Code: 7e 83 f8 01 0f 85 8d 01 00 00 9c 58 f6 c4 02 0f 85 78 01 00 00 48 f7 04 24 00 02 00 00 74 01 fb 48 b8 00 00 00 00 00 fc ff df <48> 01 c5 48 c7 45 00 00 00 00 00 c7 45 08 00 00 00 00 48 8b 84 24 RSP: 0018:ffffc90001abf730 EFLAGS: 00000206 RAX: dffffc0000000000 RBX: 6f25d58796510acf RCX: ffffc90001abf780 RDX: 1ffff11003befc43 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 1ffff92000357ee8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000004 R13: 0000000000000005 R14: ffff88801df7e220 R15: ffff88801df7d7c0 __mutex_unlock_slowpath+0x99/0x5e0 kernel/locking/mutex.c:893 device_links_write_unlock drivers/base/core.c:192 [inline] device_links_purge drivers/base/core.c:1555 [inline] device_del+0x782/0xd50 drivers/base/core.c:3585 device_unregister+0x1f/0xc0 drivers/base/core.c:3613 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: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: 00 90 65 8b 15 d9 add %dl,-0x26ea749b(%rax) 6: 0b 9f 7e 81 e2 00 or 0xe2817e(%rdi),%ebx c: 00 f0 add %dh,%al e: 00 b8 01 00 00 00 add %bh,0x1(%rax) 14: 75 0a jne 0x20 16: 8b 15 56 03 2f 0c mov 0xc2f0356(%rip),%edx # 0xc2f0372 1c: 85 d2 test %edx,%edx 1e: 75 01 jne 0x21 20: c3 retq 21: 55 push %rbp 22: 53 push %rbx 23: 65 ff 05 b8 0b 9f 7e incl %gs:0x7e9f0bb8(%rip) # 0x7e9f0be2 * 2a: e8 03 5d f0 07 callq 0x7f05d32 <-- trapping instruction 2f: 48 c7 c3 80 ab 03 00 mov $0x3ab80,%rbx 36: 83 f8 07 cmp $0x7,%eax 39: 89 c5 mov %eax,%ebp 3b: 0f .byte 0xf 3c: 87 f5 xchg %esi,%ebp