====================================================== WARNING: possible circular locking dependency detected 6.1.145-syzkaller #0 Not tainted ------------------------------------------------------ syz.9.2901/15352 is trying to acquire lock: ffff888059d7b238 (&trie->lock){-.-.}-{2:2}, at: trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 but task is already holding lock: ffff88801744e9d8 (&n->list_lock){-.-.}-{2:2}, at: get_partial_node+0x36/0x470 mm/slub.c:2210 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&n->list_lock){-.-.}-{2:2}: __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 deactivate_slab+0x208/0x470 mm/slub.c:2489 ___slab_alloc+0x55b/0x1220 mm/slub.c:3147 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node+0xa0/0x240 mm/slab_common.c:943 kmalloc_array_node include/linux/slab.h:676 [inline] kcalloc_node include/linux/slab.h:681 [inline] memcg_alloc_slab_cgroups+0x83/0x120 mm/memcontrol.c:2889 memcg_slab_post_alloc_hook mm/slab.h:528 [inline] slab_post_alloc_hook+0xba/0x480 mm/slab.h:745 slab_alloc_node mm/slub.c:3398 [inline] __kmem_cache_alloc_node+0x140/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node+0xa0/0x240 mm/slab_common.c:943 kmalloc_node include/linux/slab.h:589 [inline] bpf_map_kmalloc_node+0xb8/0x1a0 kernel/bpf/syscall.c:452 lpm_trie_node_alloc kernel/bpf/lpm_trie.c:291 [inline] trie_update_elem+0x160/0xe90 kernel/bpf/lpm_trie.c:338 bpf_map_update_value+0x5a0/0x670 kernel/bpf/syscall.c:226 generic_map_update_batch+0x569/0x850 kernel/bpf/syscall.c:1702 bpf_map_do_batch+0x466/0x600 kernel/bpf/syscall.c:-1 __sys_bpf+0x65f/0x6d0 kernel/bpf/syscall.c:-1 __do_sys_bpf kernel/bpf/syscall.c:5124 [inline] __se_sys_bpf kernel/bpf/syscall.c:5122 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5122 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (&trie->lock){-.-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:1001 [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:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 trace_contention_end+0x13f/0x190 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x7e8/0x9c0 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xb0/0xf0 kernel/locking/spinlock.c:162 get_partial_node+0x36/0x470 mm/slub.c:2210 get_partial mm/slub.c:2325 [inline] ___slab_alloc+0x968/0x1220 mm/slub.c:3175 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1b7/0x2f0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:689 [inline] fill_pool lib/debugobjects.c:169 [inline] debug_objects_fill_pool+0x34a/0x650 lib/debugobjects.c:607 debug_object_activate+0x34/0x490 lib/debugobjects.c:694 debug_rcu_head_queue kernel/rcu/rcu.h:190 [inline] kvfree_call_rcu+0xb3/0x870 kernel/rcu/tree.c:3396 hash_ipport4_add+0x1554/0x2220 net/netfilter/ipset/ip_set_hash_gen.h:979 hash_ipport4_uadt+0x980/0xc90 net/netfilter/ipset/ip_set_hash_ipport.c:188 call_ad+0x374/0xac0 net/netfilter/ipset/ip_set_core.c:1753 ip_set_ad+0x783/0x930 net/netfilter/ipset/ip_set_core.c:1843 nfnetlink_rcv_msg+0xb45/0x1120 net/netfilter/nfnetlink.c:302 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2493 nfnetlink_rcv+0x26d/0x2170 net/netfilter/nfnetlink.c:659 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x74c/0x8c0 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1859 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] ____sys_sendmsg+0x59b/0x970 net/socket.c:2519 ___sys_sendmsg+0x21c/0x290 net/socket.c:2573 __sys_sendmsg net/socket.c:2602 [inline] __do_sys_sendmsg net/socket.c:2611 [inline] __se_sys_sendmsg+0x19e/0x270 net/socket.c:2609 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&n->list_lock); lock(&trie->lock); lock(&n->list_lock); lock(&trie->lock); *** DEADLOCK *** 4 locks held by syz.9.2901/15352: #0: ffffffff9700d7f8 (nfnl_subsys_ipset){+.+.}-{3:3}, at: call_ad+0x274/0xac0 net/netfilter/ipset/ip_set_core.c:1748 #1: ffff88805d31d018 (&t->hregion[i].lock#4){+...}-{2:2}, at: spin_lock_bh include/linux/spinlock.h:356 [inline] #1: ffff88805d31d018 (&t->hregion[i].lock#4){+...}-{2:2}, at: hash_ipport4_add+0x7af/0x2220 net/netfilter/ipset/ip_set_hash_gen.h:862 #2: ffff88801744e9d8 (&n->list_lock){-.-.}-{2:2}, at: get_partial_node+0x36/0x470 mm/slub.c:2210 #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2284 [inline] #3: ffffffff8cb2ae20 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0xda/0x3b0 kernel/trace/bpf_trace.c:2324 stack backtrace: CPU: 0 PID: 15352 Comm: syz.9.2901 Not tainted 6.1.145-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3825 [inline] __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0xa4/0xf0 kernel/locking/spinlock.c:162 trie_delete_elem+0x90/0x690 kernel/bpf/lpm_trie.c:467 bpf_prog_2c29ac5cdc6b1842+0x3a/0x3e bpf_dispatcher_nop_func include/linux/bpf.h:1001 [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:2285 [inline] bpf_trace_run2+0x1cd/0x3b0 kernel/trace/bpf_trace.c:2324 trace_contention_end+0x13f/0x190 include/trace/events/lock.h:122 __pv_queued_spin_lock_slowpath+0x7e8/0x9c0 kernel/locking/qspinlock.c:560 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath+0x43/0x50 arch/x86/include/asm/qspinlock.h:51 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline] do_raw_spin_lock+0x217/0x280 kernel/locking/spinlock_debug.c:115 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] _raw_spin_lock_irqsave+0xb0/0xf0 kernel/locking/spinlock.c:162 get_partial_node+0x36/0x470 mm/slub.c:2210 get_partial mm/slub.c:2325 [inline] ___slab_alloc+0x968/0x1220 mm/slub.c:3175 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1b7/0x2f0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:689 [inline] fill_pool lib/debugobjects.c:169 [inline] debug_objects_fill_pool+0x34a/0x650 lib/debugobjects.c:607 debug_object_activate+0x34/0x490 lib/debugobjects.c:694 debug_rcu_head_queue kernel/rcu/rcu.h:190 [inline] kvfree_call_rcu+0xb3/0x870 kernel/rcu/tree.c:3396 hash_ipport4_add+0x1554/0x2220 net/netfilter/ipset/ip_set_hash_gen.h:979 hash_ipport4_uadt+0x980/0xc90 net/netfilter/ipset/ip_set_hash_ipport.c:188 call_ad+0x374/0xac0 net/netfilter/ipset/ip_set_core.c:1753 ip_set_ad+0x783/0x930 net/netfilter/ipset/ip_set_core.c:1843 nfnetlink_rcv_msg+0xb45/0x1120 net/netfilter/nfnetlink.c:302 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2493 nfnetlink_rcv+0x26d/0x2170 net/netfilter/nfnetlink.c:659 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x74c/0x8c0 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1859 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] ____sys_sendmsg+0x59b/0x970 net/socket.c:2519 ___sys_sendmsg+0x21c/0x290 net/socket.c:2573 __sys_sendmsg net/socket.c:2602 [inline] __do_sys_sendmsg net/socket.c:2611 [inline] __se_sys_sendmsg+0x19e/0x270 net/socket.c:2609 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f670d38e929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f670e1dd038 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f670d5b5fa0 RCX: 00007f670d38e929 RDX: 0000000000000090 RSI: 00002000000002c0 RDI: 0000000000000004 RBP: 00007f670d410ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f670d5b5fa0 R15: 00007ffd0d4d1048 syz.9.2901 (15352) used greatest stack depth: 19424 bytes left