============================================ WARNING: possible recursive locking detected 6.10.0-rc1-syzkaller #0 Not tainted -------------------------------------------- syz-fuzzer/5224 is trying to acquire lock: ffff8880327041d8 (&qs->lock){..-.}-{2:2}, at: __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 but task is already holding lock: ffff8880313801d8 (&qs->lock){..-.}-{2:2}, at: __stack_map_get+0x2a8/0x350 kernel/bpf/queue_stack_maps.c:140 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&qs->lock); lock(&qs->lock); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by syz-fuzzer/5224: #0: ffff88801c200258 (sk_lock-AF_INET){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1602 [inline] #0: ffff88801c200258 (sk_lock-AF_INET){+.+.}-{0:0}, at: tcp_sendmsg+0x20/0x50 net/ipv4/tcp.c:1347 #1: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #1: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #1: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #1: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run3+0x1d1/0x5a0 kernel/trace/bpf_trace.c:2445 #2: ffff8880313801d8 (&qs->lock){..-.}-{2:2}, at: __stack_map_get+0x2a8/0x350 kernel/bpf/queue_stack_maps.c:140 #3: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:329 [inline] #3: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:781 [inline] #3: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2402 [inline] #3: ffffffff8dbb18e0 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x1c2/0x590 kernel/trace/bpf_trace.c:2444 stack backtrace: CPU: 0 PID: 5224 Comm: syz-fuzzer Not tainted 6.10.0-rc1-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 check_deadlock kernel/locking/lockdep.c:3062 [inline] validate_chain kernel/locking/lockdep.c:3856 [inline] __lock_acquire+0x20e6/0x3b30 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1b1/0x560 kernel/locking/lockdep.c:5719 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:162 __queue_map_get+0x2b8/0x360 kernel/bpf/queue_stack_maps.c:105 ___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:2012 __bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2253 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run2+0x231/0x590 kernel/trace/bpf_trace.c:2444 __bpf_trace_contention_end+0xca/0x110 include/trace/events/lock.h:122 trace_contention_end.constprop.0+0xea/0x170 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x28e/0xcc0 kernel/locking/qspinlock.c:557 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline] queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline] queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x210/0x2c0 kernel/locking/spinlock_debug.c:116 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0x42/0x60 kernel/locking/spinlock.c:162 __stack_map_get+0x2a8/0x350 kernel/bpf/queue_stack_maps.c:140 ___bpf_prog_run+0x3e51/0xabd0 kernel/bpf/core.c:2012 __bpf_prog_run32+0xc1/0x100 kernel/bpf/core.c:2253 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run include/linux/filter.h:698 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2403 [inline] bpf_trace_run3+0x240/0x5a0 kernel/trace/bpf_trace.c:2445 __traceiter_kmem_cache_free+0x35/0x50 include/trace/events/kmem.h:114 trace_kmem_cache_free include/trace/events/kmem.h:114 [inline] kmem_cache_free+0x1dd/0x3a0 mm/slub.c:4510 kfree_skbmem+0x1a0/0x200 net/core/skbuff.c:1152 tcp_wmem_free_skb include/net/tcp.h:306 [inline] tcp_rtx_queue_unlink_and_free include/net/tcp.h:2094 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3378 [inline] tcp_ack+0x1eb7/0x5ba0 net/ipv4/tcp_input.c:3970 tcp_rcv_established+0x647/0x21b0 net/ipv4/tcp_input.c:6166 tcp_v4_do_rcv+0x707/0xab0 net/ipv4/tcp_ipv4.c:1914 sk_backlog_rcv include/net/sock.h:1106 [inline] __release_sock+0x31b/0x400 net/core/sock.c:2983 release_sock+0x5a/0x220 net/core/sock.c:3549 tcp_sendmsg+0x38/0x50 net/ipv4/tcp.c:1349 inet_sendmsg+0xb9/0x140 net/ipv4/af_inet.c:853 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] sock_write_iter+0x4b8/0x5c0 net/socket.c:1160 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x6b6/0x1140 fs/read_write.c:590 ksys_write+0x1f8/0x260 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x40720e Code: 48 83 ec 38 e8 13 00 00 00 48 83 c4 38 5d c3 cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 f2 48 89 fa 48 89 ce 48 89 df 0f 05 <48> 3d 01 f0 ff ff 76 15 48 f7 d8 48 89 c1 48 c7 c0 ff ff ff ff 48 RSP: 002b:000000c000692e00 EFLAGS: 00000212 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 000000000040720e RDX: 00000000000000f0 RSI: 000000c0010d8980 RDI: 0000000000000008 RBP: 000000c000692e40 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000212 R12: 000000c000692f80 R13: 0000000000000001 R14: 000000c0000061a0 R15: 000000000000000f