BUG: sleeping function called from invalid context at kernel/workqueue.c:3028 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 4456, name: kworker/u4:7 preempt_count: 100, expected: 0 RCU nest depth: 1, expected: 0 3 locks held by kworker/u4:7/4456: #0: ffff888023683138 ((wq_completion)bat_events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888023683138 ((wq_completion)bat_events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888023683138 ((wq_completion)bat_events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888023683138 ((wq_completion)bat_events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:631 [inline] #0: ffff888023683138 ((wq_completion)bat_events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:658 [inline] #0: ffff888023683138 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work+0x890/0x1680 kernel/workqueue.c:2278 #1: ffffc900043a7db0 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_one_work+0x8c4/0x1680 kernel/workqueue.c:2282 #2: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:35 [inline] #2: ffffc90000dc0d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1411 irq event stamp: 2245373 hardirqs last enabled at (2245372): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (2245372): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (2245373): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (2245373): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (2245348): [] spin_unlock_bh include/linux/spinlock.h:399 [inline] softirqs last enabled at (2245348): [] batadv_nc_purge_paths+0x2a5/0x3a0 net/batman-adv/network-coding.c:475 softirqs last disabled at (2245363): [] invoke_softirq kernel/softirq.c:432 [inline] softirqs last disabled at (2245363): [] __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: 4456 Comm: kworker/u4:7 Not tainted 5.16.0-rc5-next-20211216-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: bat_events batadv_nc_worker 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_tx_complete+0x34a/0x3e0 drivers/bluetooth/btusb.c:1402 __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:trace_lock_acquire include/trace/events/lock.h:13 [inline] RIP: 0010:lock_acquire+0xc5/0x510 kernel/locking/lockdep.c:5610 Code: 08 00 00 00 48 89 d0 48 89 54 24 08 48 c1 f8 06 48 8d 3c c5 90 cd 92 8d e8 d8 24 66 00 48 8b 54 24 08 48 0f a3 15 fb df 35 0c <0f> 82 64 03 00 00 48 c7 c0 ec 00 93 8d 48 ba 00 00 00 00 00 fc ff RSP: 0018:ffffc900043a7ba0 EFLAGS: 00000247 RAX: 0000000000000001 RBX: 1ffff92000874f76 RCX: ffffffff815ced88 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffff8d92cd90 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8d92cd97 R10: fffffbfff1b259b2 R11: 0000000000000000 R12: 0000000000000002 R13: 0000000000000000 R14: ffffffff8bb82400 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:268 [inline] rcu_read_lock include/linux/rcupdate.h:694 [inline] batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline] batadv_nc_worker+0x12d/0xfa0 net/batman-adv/network-coding.c:723 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: 08 00 or %al,(%rax) 2: 00 00 add %al,(%rax) 4: 48 89 d0 mov %rdx,%rax 7: 48 89 54 24 08 mov %rdx,0x8(%rsp) c: 48 c1 f8 06 sar $0x6,%rax 10: 48 8d 3c c5 90 cd 92 lea -0x726d3270(,%rax,8),%rdi 17: 8d 18: e8 d8 24 66 00 callq 0x6624f5 1d: 48 8b 54 24 08 mov 0x8(%rsp),%rdx 22: 48 0f a3 15 fb df 35 bt %rdx,0xc35dffb(%rip) # 0xc35e025 29: 0c * 2a: 0f 82 64 03 00 00 jb 0x394 <-- trapping instruction 30: 48 c7 c0 ec 00 93 8d mov $0xffffffff8d9300ec,%rax 37: 48 rex.W 38: ba 00 00 00 00 mov $0x0,%edx 3d: 00 fc add %bh,%ah 3f: ff .byte 0xff