================================ WARNING: inconsistent lock state 5.10.0-syzkaller #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. syz-executor.5/8651 [HC0[0]:SC1[1]:HE1:SE0] takes: ffff88801c204aa8 (&file_data->lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:354 [inline] ffff88801c204aa8 (&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+0x343a/0x40d0 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: 4156668 hardirqs last enabled at (4156668): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (4156668): [] _raw_spin_unlock_irqrestore+0x42/0x50 kernel/locking/spinlock.c:191 hardirqs last disabled at (4156667): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (4156667): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (4156580): [] do_ipv6_setsockopt.constprop.0+0x482/0x4140 net/ipv6/ipv6_sockglue.c:979 softirqs last disabled at (4156603): [] 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.5/8651: #0: ffff888023324d88 (&xt[i].mutex){+.+.}-{3:3}, at: xt_find_table_lock+0x41/0x540 net/netfilter/x_tables.c:1206 #1: ffffffff8b3391e0 (rcu_read_lock){....}-{1:2}, at: is_bpf_text_address+0x0/0x160 kernel/bpf/core.c:695 #2: ffffffff8b3390c0 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2479 [inline] #2: ffffffff8b3390c0 (rcu_callback){....}-{0:0}, at: rcu_core+0x582/0xf00 kernel/rcu/tree.c:2723 #3: ffffffff8b3391e0 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x250 net/netfilter/xt_cgroup.c:62 stack backtrace: CPU: 0 PID: 8651 Comm: syz-executor.5 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:arch_local_irq_restore arch/x86/include/asm/irqflags.h:85 [inline] RIP: 0010:lock_acquire kernel/locking/lockdep.c:5440 [inline] RIP: 0010:lock_acquire+0x2c7/0x740 kernel/locking/lockdep.c:5402 Code: 48 c7 c7 20 68 4b 89 48 83 c4 20 e8 13 c0 90 07 b8 ff ff ff ff 65 0f c1 05 36 7f ab 7e 83 f8 01 0f 85 36 03 00 00 ff 34 24 9d 3a fe ff ff 65 ff 05 9d 6d ab 7e 48 8b 05 d6 86 82 0b e8 31 b5 RSP: 0018:ffffc90001827358 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 1ffff92000304e6d RCX: 0000000000000001 RDX: 1ffff1100ea9e148 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: ffffffff8ebba767 R10: fffffbfff1d774ec R11: 0000000000000001 R12: 0000000000000002 R13: ffffffff8b3391e0 R14: 0000000000000000 R15: 0000000000000000 rcu_lock_acquire include/linux/rcupdate.h:253 [inline] rcu_read_lock include/linux/rcupdate.h:642 [inline] is_bpf_text_address+0x36/0x160 kernel/bpf/core.c:708 kernel_text_address kernel/extable.c:151 [inline] kernel_text_address+0xbd/0xf0 kernel/extable.c:120 __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 __do_kmalloc mm/slab.c:3657 [inline] __kmalloc+0x225/0x450 mm/slab.c:3666 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:664 [inline] xt_jumpstack_alloc net/netfilter/x_tables.c:1303 [inline] xt_replace_table+0x372/0x600 net/netfilter/x_tables.c:1369 __do_replace+0x1d7/0x8c0 net/ipv6/netfilter/ip6_tables.c:1083 do_replace net/ipv6/netfilter/ip6_tables.c:1156 [inline] do_ip6t_set_ctl+0x8ec/0xb70 net/ipv6/netfilter/ip6_tables.c:1636 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x122/0x180 net/ipv6/ipv6_sockglue.c:1008 tcp_setsockopt+0x136/0x2590 net/ipv4/tcp.c:3338 __sys_setsockopt+0x2db/0x610 net/socket.c:2132 __do_sys_setsockopt net/socket.c:2143 [inline] __se_sys_setsockopt net/socket.c:2140 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2140 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x460c8a Code: 49 89 ca b8 37 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 ca 88 fb ff c3 66 0f 1f 84 00 00 00 00 00 49 89 ca b8 36 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 aa 88 fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007ffdaa5355d8 EFLAGS: 00000206 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007ffdaa535600 RCX: 0000000000460c8a RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003 RBP: 000000000074cca0 R08: 00000000000003b8 R09: 0000000000004000 R10: 000000000074ab40 R11: 0000000000000206 R12: 00007ffdaa535660 R13: 0000000000000003 R14: 000000000074aae0 R15: 0000000000000029