================================ 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/11826 [HC0[0]:SC1[1]:HE0:SE0] takes: ffff8880257de618 (&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: 3181 hardirqs last enabled at (3180): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (3180): [] _raw_spin_unlock_irqrestore+0x6f/0x90 kernel/locking/spinlock.c:191 hardirqs last disabled at (3181): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (3181): [] _raw_spin_lock_irqsave+0xa9/0xd0 kernel/locking/spinlock.c:159 softirqs last enabled at (826): [] asm_call_irq_on_stack+0xf/0x20 softirqs last disabled at (3157): [] 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/11826: #0: ffff888020ca2460 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1648 [inline] #0: ffff888020ca2460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:354 #1: ffff888033aff5c8 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:809 [inline] #1: ffff888033aff5c8 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: filename_create+0x15a/0x490 fs/namei.c:3467 #2: ffffffff8a554da0 (rcu_read_lock){....}-{1:2}, at: find_get_entry+0x0/0x570 arch/x86/include/asm/bitops.h:207 #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: 11826 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:arch_local_irq_restore+0x2e/0x50 arch/x86/include/asm/paravirt.h:653 Code: 01 3d 8a 53 48 89 fb 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 18 48 83 3d 31 f6 e2 08 00 74 0c 48 89 df 57 9d <0f> 1f 44 00 00 5b c3 0f 0b 48 c7 c7 e8 01 3d 8a e8 6d 37 5d 00 eb RSP: 0018:ffffc900171ff888 EFLAGS: 00000282 RAX: 1ffffffff147a03d RBX: 0000000000000282 RCX: 00000000ffffffff RDX: dffffc0000000000 RSI: ffffffff8a554da0 RDI: 0000000000000282 RBP: ffff888072a6e300 R08: 0000000000000001 R09: ffffffff8d7329a7 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001 R13: ffff888072a6ec18 R14: ffff888072a6ec68 R15: 0000000000000282 lock_is_held_type+0xbb/0xf0 kernel/locking/lockdep.c:5460 xa_entry include/linux/xarray.h:1180 [inline] xas_descend+0x2b9/0x380 lib/xarray.c:204 xas_load+0xe5/0x140 lib/xarray.c:240 find_get_entry+0x12a/0x570 mm/filemap.c:1686 pagecache_get_page+0x5e/0x1460 mm/filemap.c:1785 find_get_page_flags include/linux/pagemap.h:338 [inline] __find_get_block_slow fs/buffer.c:202 [inline] __find_get_block fs/buffer.c:1365 [inline] __find_get_block+0x572/0xff0 fs/buffer.c:1359 sb_find_get_block include/linux/buffer_head.h:338 [inline] recently_deleted fs/ext4/ialloc.c:682 [inline] find_inode_bit+0x224/0x570 fs/ext4/ialloc.c:724 __ext4_new_inode+0xbd2/0x5120 fs/ext4/ialloc.c:936 ext4_symlink+0x3c9/0xd20 fs/ext4/namei.c:3314 vfs_symlink fs/namei.c:3960 [inline] vfs_symlink+0x44e/0x690 fs/namei.c:3946 do_symlinkat+0x258/0x2c0 fs/namei.c:3987 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45db57 Code: 0f 1f 00 b8 5c 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 cd b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 58 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffd1b00d3c8 EFLAGS: 00000202 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000045db57 RDX: 00007ffd1b00d463 RSI: 00000000004c3876 RDI: 00007ffd1b00d450 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000013 R10: 0000000000000075 R11: 0000000000000202 R12: 0000000000000001 R13: 00007ffd1b00d400 R14: 0000000000000000 R15: 00007ffd1b00d410