================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.0/21408 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff8880196f0ea8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff8880196f0ea8 (&file_data->lock){+.?.}-{2:2}, at: io_file_data_ref_zero+0x75/0x480 fs/io_uring.c:7361 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x740 kernel/locking/lockdep.c:5402 __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_sqe_files_register fs/io_uring.c:7496 [inline] __io_uring_register fs/io_uring.c:9665 [inline] __do_sys_io_uring_register+0x338f/0x4080 fs/io_uring.c:9755 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 irq event stamp: 17566 hardirqs last enabled at (17566): [] asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 hardirqs last disabled at (17565): [] sysvec_apic_timer_interrupt+0xc/0x100 arch/x86/kernel/apic/apic.c:1096 softirqs last enabled at (16678): [] asm_call_irq_on_stack+0xf/0x20 softirqs last disabled at (17511): [] asm_call_irq_on_stack+0xf/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&file_data->lock); lock(&file_data->lock); *** DEADLOCK *** 4 locks held by syz-executor.0/21408: #0: ffffc90002fd10a8 (&kvm->slots_lock){+.+.}-{3:3}, at: alloc_apic_access_page arch/x86/kvm/vmx/vmx.c:3610 [inline] #0: ffffc90002fd10a8 (&kvm->slots_lock){+.+.}-{3:3}, at: vmx_create_vcpu+0x2686/0x4240 arch/x86/kvm/vmx/vmx.c:6921 #1: ffff8880138c88d8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #1: ffff8880138c88d8 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x15c/0x290 mm/util.c:505 #2: ffffffff8b339e40 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #2: ffffffff8b339e40 (rcu_callback){....}-{0:0}, at: rcu_core+0x582/0xf00 kernel/rcu/tree.c:2723 #3: ffffffff8b339f60 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x250 net/netfilter/xt_cgroup.c:62 stack backtrace: CPU: 1 PID: 21408 Comm: syz-executor.0 Not tainted 5.10.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_usage_bug kernel/locking/lockdep.c:3740 [inline] valid_state kernel/locking/lockdep.c:3751 [inline] mark_lock_irq kernel/locking/lockdep.c:3954 [inline] mark_lock.cold+0x31/0x73 kernel/locking/lockdep.c:4411 mark_usage kernel/locking/lockdep.c:4306 [inline] __lock_acquire+0x11a5/0x5500 kernel/locking/lockdep.c:4786 lock_acquire kernel/locking/lockdep.c:5437 [inline] lock_acquire+0x29d/0x740 kernel/locking/lockdep.c:5402 __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_file_data_ref_zero+0x75/0x480 fs/io_uring.c:7361 percpu_ref_put_many.constprop.0+0x217/0x250 include/linux/percpu-refcount.h:322 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x5eb/0xf00 kernel/rcu/tree.c:2723 __do_softirq+0x2a0/0x9f6 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+0xaa/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+0x132/0x200 kernel/softirq.c:435 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:core_kernel_text kernel/extable.c:79 [inline] RIP: 0010:kernel_text_address+0x21/0xf0 kernel/extable.c:125 Code: c3 0f 1f 84 00 00 00 00 00 55 48 89 fd 48 83 ec 08 48 81 ff 00 00 00 81 72 09 48 81 ff d0 7f 20 89 72 4c 48 c7 c0 04 2e ed 8c <48> ba 00 00 00 00 00 fc ff df 48 89 c1 83 e0 07 48 c1 e9 03 83 c0 RSP: 0018:ffffc90003407158 EFLAGS: 00000207 RAX: ffffffff8ced2e04 RBX: 000000000045e159 RCX: 0000000000000000 RDX: 1ffff92000680e3c RSI: 1ffff92000680e3c RDI: 000000000045e159 RBP: 000000000045e159 R08: ffffffff8df73852 R09: ffffffff8df73856 R10: 0000000000082081 R11: 0000000000000001 R12: ffffc90003407250 R13: 0000000000000000 R14: ffff888077320040 R15: 00000000000001e8 __kernel_text_address+0x9/0x30 kernel/extable.c:105 unwind_get_return_address arch/x86/kernel/unwind_orc.c:318 [inline] unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:313 arch_stack_walk+0x93/0xe0 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:121 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc mm/slab.c:3315 [inline] kmem_cache_alloc+0x1c7/0x4e0 mm/slab.c:3486 kmem_cache_zalloc include/linux/slab.h:672 [inline] __alloc_file+0x21/0x350 fs/file_table.c:101 alloc_empty_file+0x6d/0x170 fs/file_table.c:151 alloc_file+0x5e/0x5a0 fs/file_table.c:193 alloc_file_pseudo+0x165/0x250 fs/file_table.c:233 __shmem_file_setup mm/shmem.c:4210 [inline] __shmem_file_setup+0x144/0x310 mm/shmem.c:4184 shmem_kernel_file_setup mm/shmem.c:4229 [inline] shmem_zero_setup+0x93/0x480 mm/shmem.c:4273 mmap_region+0x118d/0x1710 mm/mmap.c:1844 do_mmap+0xcff/0x11d0 mm/mmap.c:1583 vm_mmap_pgoff+0x1b7/0x290 mm/util.c:507 vm_mmap+0x92/0xc0 mm/util.c:526 __x86_set_memory_region+0x268/0x5d0 arch/x86/kvm/x86.c:10372 alloc_apic_access_page arch/x86/kvm/vmx/vmx.c:3613 [inline] vmx_create_vcpu+0x1e9b/0x4240 arch/x86/kvm/vmx/vmx.c:6921 kvm_arch_vcpu_create+0x695/0xb20 arch/x86/kvm/x86.c:9917 kvm_vm_ioctl_create_vcpu arch/x86/kvm/../../../virt/kvm/kvm_main.c:3128 [inline] kvm_vm_ioctl+0x14fa/0x22f0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3689 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl fs/ioctl.c:739 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e159 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f1ef8fe2c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 000000000045e159 RDX: 0000000000000001 RSI: 000000000000ae41 RDI: 0000000000000005 RBP: 000000000119bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffc20e2f1df R14: 00007f1ef8fe39c0 R15: 000000000119bf8c