============================================ WARNING: possible recursive locking detected 6.1.90-syzkaller #0 Not tainted -------------------------------------------- syz-executor.2/3571 is trying to acquire lock: ffffc9000a9f50d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410 but task is already holding lock: ffffc9000a9710d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410 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 4 locks held by syz-executor.2/3571: #0: ffffffff8e300928 (nf_sockopt_mutex){+.+.}-{3:3}, at: nf_sockopt_find net/netfilter/nf_sockopt.c:67 [inline] #0: ffffffff8e300928 (nf_sockopt_mutex){+.+.}-{3:3}, at: nf_getsockopt+0x32/0x2b0 net/netfilter/nf_sockopt.c:113 #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #1: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312 #2: ffffc9000a9710d8 (&rb->spinlock){-.-.}-{2:2}, at: __bpf_ringbuf_reserve+0x20d/0x4f0 kernel/bpf/ringbuf.c:410 #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline] #3: ffffffff8d12ac80 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312 stack backtrace: CPU: 1 PID: 3571 Comm: syz-executor.2 Not tainted 6.1.90-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 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+0x20d/0x4f0 kernel/bpf/ringbuf.c:410 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:445 [inline] bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:437 bpf_prog_8c296d0debb99b26+0x25/0x42 bpf_dispatcher_nop_func include/linux/bpf.h:989 [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:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 __traceiter_contention_end+0x74/0xa0 include/trace/events/lock.h:122 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+0x20d/0x4f0 kernel/bpf/ringbuf.c:410 ____bpf_ringbuf_reserve kernel/bpf/ringbuf.c:445 [inline] bpf_ringbuf_reserve+0x58/0x70 kernel/bpf/ringbuf.c:437 bpf_prog_8c296d0debb99b26+0x25/0x42 bpf_dispatcher_nop_func include/linux/bpf.h:989 [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:2273 [inline] bpf_trace_run2+0x1fd/0x410 kernel/trace/bpf_trace.c:2312 __traceiter_contention_end+0x74/0xa0 include/trace/events/lock.h:122 trace_contention_end+0x12f/0x170 include/trace/events/lock.h:122 __mutex_lock_common kernel/locking/mutex.c:612 [inline] __mutex_lock+0x2ed/0xd80 kernel/locking/mutex.c:747 nf_sockopt_find net/netfilter/nf_sockopt.c:67 [inline] nf_getsockopt+0x32/0x2b0 net/netfilter/nf_sockopt.c:113 ip_getsockopt+0x21a/0x2d0 net/ipv4/ip_sockglue.c:1826 tcp_getsockopt+0x15c/0x1c0 net/ipv4/tcp.c:4445 __sys_getsockopt+0x2b2/0x5d0 net/socket.c:2327 __do_sys_getsockopt net/socket.c:2342 [inline] __se_sys_getsockopt net/socket.c:2339 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2339 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f3992c7f90a Code: c4 c1 e0 1a 0d 00 00 04 00 89 01 e9 e0 fe ff ff e8 3b 05 00 00 66 2e 0f 1f 84 00 00 00 00 00 90 49 89 ca b8 37 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 06 c3 0f 1f 44 00 00 48 c7 c2 b0 ff ff ff f7 RSP: 002b:00007ffd3321b438 EFLAGS: 00000212 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f3992c7f90a RDX: 0000000000000061 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007ffd3321b4a0 R08: 00007ffd3321b44c R09: 00007ffd3321b837 R10: 00007ffd3321b4a0 R11: 0000000000000212 R12: 00007ffd3321b44c R13: 000000000001edba R14: 000000000001ed8a R15: 0000000000000003