============================================
WARNING: possible recursive locking detected
6.1.129-syzkaller #0 Not tainted
--------------------------------------------
kworker/u4:6/4330 is trying to acquire lock:
ffffc900041590d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413
but task is already holding lock:
ffffc900047e10d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&rb->spinlock);
lock(&rb->spinlock);
*** DEADLOCK ***
May be due to missing lock nesting notation
9 locks held by kworker/u4:6/4330:
#0: ffff888017e16938 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x806/0x1260 kernel/workqueue.c:2267
#1: ffffc900041d7d20 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x806/0x1260 kernel/workqueue.c:2267
#2: ffffffff8e542f90 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x166/0xd20 net/core/net_namespace.c:594
#3: ffffffff8e54faa8 (rtnl_mutex){+.+.}-{3:3}, at: ip_tunnel_delete_nets+0xca/0x360 net/ipv4/ip_tunnel.c:1166
#4: ffff888017c73548 (&root->kernfs_rwsem){++++}-{3:3}, at: kernfs_remove_by_name_ns+0x76/0x150 fs/kernfs/dir.c:1661
#5: ffffffff8d32e740 (rcu_callback){....}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#5: ffffffff8d32e740 (rcu_callback){....}-{0:0}, at: rcu_do_batch kernel/rcu/tree.c:2291 [inline]
#5: ffffffff8d32e740 (rcu_callback){....}-{0:0}, at: rcu_core+0xa6b/0x1820 kernel/rcu/tree.c:2557
#6: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#6: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#6: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2283 [inline]
#6: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x146/0x440 kernel/trace/bpf_trace.c:2324
#7: ffffc900047e10d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413
#8: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#8: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#8: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2283 [inline]
#8: ffffffff8d32e680 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2323
stack backtrace:
CPU: 1 PID: 4330 Comm: kworker/u4:6 Not tainted 6.1.129-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Workqueue: netns cleanup_net
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2983 [inline]
check_deadlock kernel/locking/lockdep.c:3026 [inline]
validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413
____bpf_ringbuf_output kernel/bpf/ringbuf.c:539 [inline]
bpf_ringbuf_output+0x63/0x1e0 kernel/bpf/ringbuf.c:529
bpf_prog_044b88d9c832e6f0+0x45/0x49
bpf_dispatcher_nop_func include/linux/bpf.h:1000 [inline]
__bpf_prog_run include/linux/filter.h:603 [inline]
bpf_prog_run include/linux/filter.h:610 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline]
bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2323
trace_contention_end+0x14c/0x190 include/trace/events/lock.h:122
__pv_queued_spin_lock_slowpath+0x935/0xc50 kernel/locking/qspinlock.c:560
pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline]
queued_spin_lock_slowpath+0x42/0x50 arch/x86/include/asm/qspinlock.h:51
queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
do_raw_spin_lock+0x269/0x370 kernel/locking/spinlock_debug.c:115
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline]
_raw_spin_lock_irqsave+0xdd/0x120 kernel/locking/spinlock.c:162
__bpf_ringbuf_reserve+0x1e6/0x600 kernel/bpf/ringbuf.c:413
____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:464 [inline]
bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:456
bpf_prog_fe0ed97373b08409+0x25/0x42
bpf_dispatcher_nop_func include/linux/bpf.h:1000 [inline]
__bpf_prog_run include/linux/filter.h:603 [inline]
bpf_prog_run include/linux/filter.h:610 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline]
bpf_trace_run3+0x231/0x440 kernel/trace/bpf_trace.c:2324
__bpf_trace_kmem_cache_free+0x99/0xc0 include/trace/events/kmem.h:114
trace_kmem_cache_free include/trace/events/kmem.h:114 [inline]
kmem_cache_free+0x418/0x510 mm/slub.c:3682
rcu_do_batch kernel/rcu/tree.c:2297 [inline]
rcu_core+0xade/0x1820 kernel/rcu/tree.c:2557
handle_softirqs+0x2ee/0xa40 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0x157/0x240 kernel/softirq.c:661
irq_exit_rcu+0x5/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691
RIP: 0010:lock_is_held_type+0x137/0x180
Code: 75 40 48 c7 04 24 00 00 00 00 9c 8f 04 24 f7 04 24 00 02 00 00 75 46 41 f7 c4 00 02 00 00 74 01 fb 65 48 8b 04 25 28 00 00 00 <48> 3b 44 24 08 75 3c 89 e8 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f
RSP: 0018:ffffc900041d7658 EFLAGS: 00000206
RAX: e201b7aa09f80e00 RBX: 0000000000000004 RCX: ffff88803155bb80
RDX: ffff88803155bb80 RSI: ffffffff8b0c2ec0 RDI: ffffffff8b5f6d80
RBP: 0000000000000001 R08: ffffffff82195a4b R09: ffffed100b0e855d
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000246
R13: ffff88803155bb80 R14: 00000000ffffffff R15: ffff888017c73548
lock_is_held include/linux/lockdep.h:283 [inline]
kernfs_active fs/kernfs/dir.c:41 [inline]
__kernfs_remove+0x21a/0x710 fs/kernfs/dir.c:1445
kernfs_remove_by_name_ns+0xd4/0x150 fs/kernfs/dir.c:1666
kernfs_remove_by_name include/linux/kernfs.h:622 [inline]
remove_files fs/sysfs/group.c:28 [inline]
sysfs_remove_group+0xfa/0x2a0 fs/sysfs/group.c:288
sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:312
__kobject_del+0x84/0x310 lib/kobject.c:587
kobject_cleanup lib/kobject.c:672 [inline]
kobject_release lib/kobject.c:712 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x238/0x460 lib/kobject.c:729
net_rx_queue_update_kobjects+0x44f/0x4c0 net/core/net-sysfs.c:1126
remove_queue_kobjects net/core/net-sysfs.c:1827 [inline]
netdev_unregister_kobject+0x106/0x250 net/core/net-sysfs.c:1981
unregister_netdevice_many+0x123c/0x1710 net/core/dev.c:10974
ip_tunnel_delete_nets+0x318/0x360 net/ipv4/ip_tunnel.c:1171
ops_exit_list net/core/net_namespace.c:177 [inline]
cleanup_net+0x886/0xd20 net/core/net_namespace.c:640
process_one_work+0x917/0x1260 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
----------------
Code disassembly (best guess):
0: 75 40 jne 0x42
2: 48 c7 04 24 00 00 00 movq $0x0,(%rsp)
9: 00
a: 9c pushf
b: 8f 04 24 pop (%rsp)
e: f7 04 24 00 02 00 00 testl $0x200,(%rsp)
15: 75 46 jne 0x5d
17: 41 f7 c4 00 02 00 00 test $0x200,%r12d
1e: 74 01 je 0x21
20: fb sti
21: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax
28: 00 00
* 2a: 48 3b 44 24 08 cmp 0x8(%rsp),%rax <-- trapping instruction
2f: 75 3c jne 0x6d
31: 89 e8 mov %ebp,%eax
33: 48 83 c4 10 add $0x10,%rsp
37: 5b pop %rbx
38: 41 5c pop %r12
3a: 41 5d pop %r13
3c: 41 5e pop %r14
3e: 41 5f pop %r15