================================ WARNING: inconsistent lock state 5.9.0-rc8-next-20201008-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.1/6906 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff888033556618 (&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: 715273 hardirqs last enabled at (715272): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (715272): [] _raw_spin_unlock_irqrestore+0x6f/0x90 kernel/locking/spinlock.c:191 hardirqs last disabled at (715273): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (715273): [] _raw_spin_lock_irqsave+0xa9/0xd0 kernel/locking/spinlock.c:159 softirqs last enabled at (710706): [] memcpy include/linux/string.h:399 [inline] softirqs last enabled at (710706): [] fpu__copy+0x176/0x6a0 arch/x86/kernel/fpu/core.c:240 softirqs last disabled at (715175): [] 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 syz-executor.1/6906: #0: ffff88802096a460 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1648 [inline] #0: ffff88802096a460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:354 #1: ffff8880271a0688 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:809 [inline] #1: ffff8880271a0688 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: do_rmdir+0x233/0x440 fs/namei.c:3762 #2: ffffffff8abc0880 (tomoyo_ss){....}-{0:0}, at: tomoyo_path_perm+0x1c1/0x400 security/tomoyo/file.c:847 #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: 0 PID: 6906 Comm: syz-executor.1 Not tainted 5.9.0-rc8-next-20201008-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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:check_kcov_mode kernel/kcov.c:163 [inline] RIP: 0010:write_comp_data+0x13/0x80 kernel/kcov.c:218 Code: 48 8b 80 50 14 00 00 c3 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 49 89 f2 65 8b 05 76 a8 8c 7e 65 48 8b 34 25 c0 fe 01 00 00 01 ff 00 74 0f f6 c4 01 74 59 8b 86 5c 14 00 00 85 c0 74 4f RSP: 0018:ffffc900016578e0 EFLAGS: 00000202 RAX: 0000000080000000 RBX: 0000000000000007 RCX: ffffffff8386a3c9 RDX: 0000000000000000 RSI: ffff888032a48040 RDI: 0000000000000001 RBP: ffffffff88f289c0 R08: 0000000000000001 R09: ffffffff8dc6a6e7 R10: 0000000000000008 R11: 0000000000000000 R12: 0000000000000007 R13: 0000000000000368 R14: dffffc0000000000 R15: 0000000000000000 __sanitizer_cov_trace_switch+0x45/0x70 kernel/kcov.c:320 tomoyo_domain_quota_is_ok+0x1c9/0x550 security/tomoyo/util.c:1056 tomoyo_supervisor+0x2f2/0xef0 security/tomoyo/common.c:2089 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573 tomoyo_path_perm+0x33b/0x400 security/tomoyo/file.c:838 tomoyo_path_rmdir+0x8e/0xd0 security/tomoyo/tomoyo.c:183 security_path_rmdir+0xd7/0x150 security/security.c:1094 do_rmdir+0x2a8/0x440 fs/namei.c:3771 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45db97 Code: 00 66 90 b8 57 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 8d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 6d b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffdbf835288 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 000000000045db97 RDX: 0000000000000000 RSI: 000000000074e678 RDI: 00007ffdbf8363c0 RBP: 0000000000000061 R08: 0000000000000000 R09: 0000000000000001 R10: 0000000000000006 R11: 0000000000000207 R12: 00007ffdbf8363c0 R13: 000000000272ea60 R14: 0000000000000000 R15: 00007ffdbf8363c0