================================ WARNING: inconsistent lock state 5.9.0-rc8-next-20201008-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. kworker/u4:0/7 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff88802ab45218 (&xa->xa_lock#9){+.?.}-{2:2}, at: xa_destroy+0xaa/0x350 lib/xarray.c:2205 {SOFTIRQ-ON-W} state was registered at: lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5419 __raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:151 spin_lock include/linux/spinlock.h:354 [inline] io_uring_add_task_file fs/io_uring.c:8607 [inline] io_uring_add_task_file+0x207/0x430 fs/io_uring.c:8590 io_uring_get_fd fs/io_uring.c:9116 [inline] io_uring_create fs/io_uring.c:9280 [inline] io_uring_setup+0x2727/0x3660 fs/io_uring.c:9314 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 82625105 hardirqs last enabled at (82625104): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (82625104): [] _raw_spin_unlock_irqrestore+0x6f/0x90 kernel/locking/spinlock.c:191 hardirqs last disabled at (82625105): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (82625105): [] _raw_spin_lock_irqsave+0xa9/0xd0 kernel/locking/spinlock.c:159 softirqs last enabled at (82625018): [] spin_unlock_bh include/linux/spinlock.h:399 [inline] softirqs last enabled at (82625018): [] batadv_nc_purge_paths+0x2a5/0x3a0 net/batman-adv/network-coding.c:470 softirqs last disabled at (82625043): [] asm_call_irq_on_stack+0xf/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&xa->xa_lock#9); lock(&xa->xa_lock#9); *** DEADLOCK *** 4 locks held by kworker/u4:0/7: #0: ffff8881373f8938 ((wq_completion)bat_events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff8881373f8938 ((wq_completion)bat_events){+.+.}-{0:0}, at: atomic64_set include/asm-generic/atomic-instrumented.h:856 [inline] #0: ffff8881373f8938 ((wq_completion)bat_events){+.+.}-{0:0}, at: atomic_long_set include/asm-generic/atomic-long.h:41 [inline] #0: ffff8881373f8938 ((wq_completion)bat_events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:616 [inline] #0: ffff8881373f8938 ((wq_completion)bat_events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:643 [inline] #0: ffff8881373f8938 ((wq_completion)bat_events){+.+.}-{0:0}, at: process_one_work+0x821/0x15a0 kernel/workqueue.c:2240 #1: ffffc90000cdfda8 ((work_completion)(&(&bat_priv->nc.work)->work)){+.+.}-{0:0}, at: process_one_work+0x854/0x15a0 kernel/workqueue.c:2244 #2: ffffffff8a554da0 (rcu_read_lock){....}-{1:2}, at: batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:405 [inline] #2: ffffffff8a554da0 (rcu_read_lock){....}-{1:2}, at: batadv_nc_worker+0xf3/0xe50 net/batman-adv/network-coding.c:718 #3: ffffffff8a554c80 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2474 [inline] #3: ffffffff8a554c80 (rcu_callback){....}-{0:0}, at: rcu_core+0x5d8/0x1240 kernel/rcu/tree.c:2718 stack backtrace: CPU: 1 PID: 7 Comm: kworker/u4:0 Not tainted 5.9.0-rc8-next-20201008-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:77 [inline] dump_stack+0x198/0x1fb lib/dump_stack.c:118 print_usage_bug kernel/locking/lockdep.c:3715 [inline] valid_state kernel/locking/lockdep.c:3726 [inline] mark_lock_irq kernel/locking/lockdep.c:3929 [inline] mark_lock.cold+0x32/0x74 kernel/locking/lockdep.c:4396 mark_usage kernel/locking/lockdep.c:4281 [inline] __lock_acquire+0x118a/0x56d0 kernel/locking/lockdep.c:4771 lock_acquire+0x1f2/0xaa0 kernel/locking/lockdep.c:5419 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x94/0xd0 kernel/locking/spinlock.c:159 xa_destroy+0xaa/0x350 lib/xarray.c:2205 __io_uring_free+0x60/0xc0 fs/io_uring.c:7693 io_uring_free include/linux/io_uring.h:40 [inline] __put_task_struct+0xff/0x3f0 kernel/fork.c:732 put_task_struct include/linux/sched/task.h:111 [inline] delayed_put_task_struct+0x1f6/0x340 kernel/exit.c:172 rcu_do_batch kernel/rcu/tree.c:2484 [inline] rcu_core+0x645/0x1240 kernel/rcu/tree.c:2718 __do_softirq+0x203/0xab6 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x9b/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:393 [inline] __irq_exit_rcu kernel/softirq.c:423 [inline] irq_exit_rcu+0x235/0x280 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x51/0xf0 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:631 RIP: 0010:batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:408 [inline] RIP: 0010:batadv_nc_worker+0x160/0xe50 net/batman-adv/network-coding.c:718 Code: 89 c6 e8 13 7b 75 f9 85 ed 58 74 1e e8 a9 7e 75 f9 0f b6 2d f4 00 af 03 31 ff 89 ee e8 b9 7a 75 f9 40 84 ed 0f 84 bc 08 00 00 8b 7e 75 f9 48 89 d8 48 c1 e8 03 42 80 3c 30 00 0f 85 ba 0b 00 RSP: 0018:ffffc90000cdfc90 EFLAGS: 00000202 RAX: 0000000000000000 RBX: ffff88802a0b8ac0 RCX: ffffffff87ffe521 RDX: 0000000000000001 RSI: ffff88800fa841c0 RDI: 0000000000000001 RBP: 0000000000000001 R08: 0000000000000000 R09: ffffffff8d7329a7 R10: 0000000000000000 R11: 0000000000000000 R12: ffffc90000cdfda8 R13: 0000000000000000 R14: dffffc0000000000 R15: 0000000000000158 process_one_work+0x933/0x15a0 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3af/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296