====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.7962/13647 is trying to acquire lock: ffffffff9a2d6878 (nfnl_subsys_ipset){+.+.}-{4:4}, at: ip_set_nfnl_get_byindex+0x67/0x230 net/netfilter/ipset/ip_set_core.c:909 but task is already holding lock: ffff88804c36a4d8 (&nft_net->commit_mutex){+.+.}-{4:4}, at: nf_tables_valid_genid+0x3b/0x100 net/netfilter/nf_tables_api.c:11559 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&nft_net->commit_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776 nf_tables_dumpreset_set+0xc5/0x290 net/netfilter/nf_tables_api.c:6348 netlink_dump+0x722/0xe80 net/netlink/af_netlink.c:2325 __netlink_dump_start+0x5cb/0x7e0 net/netlink/af_netlink.c:2440 netlink_dump_start include/linux/netlink.h:341 [inline] nft_netlink_dump_start_rcu+0xdb/0x1a0 net/netfilter/nf_tables_api.c:1309 nf_tables_getsetelem_reset+0x2fb/0xab0 net/netfilter/nf_tables_api.c:6664 nfnetlink_rcv_msg+0x8ae/0x12c0 net/netfilter/nfnetlink.c:290 netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2550 nfnetlink_rcv+0x2c0/0x27b0 net/netfilter/nfnetlink.c:669 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x4d7/0x810 net/socket.c:2592 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (nlk_cb_mutex-NETFILTER){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776 __netlink_dump_start+0xfe/0x7e0 net/netlink/af_netlink.c:2404 netlink_dump_start include/linux/netlink.h:341 [inline] ip_set_dump+0x15b/0x1f0 net/netfilter/ipset/ip_set_core.c:1717 nfnetlink_rcv_msg+0xc00/0x12c0 net/netfilter/nfnetlink.c:302 netlink_rcv_skb+0x232/0x4b0 net/netlink/af_netlink.c:2550 nfnetlink_rcv+0x2c0/0x27b0 net/netfilter/nfnetlink.c:669 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x4d7/0x810 net/socket.c:2592 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (nfnl_subsys_ipset){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x106/0x330 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776 ip_set_nfnl_get_byindex+0x67/0x230 net/netfilter/ipset/ip_set_core.c:909 set_target_v1_checkentry+0x8c/0x500 net/netfilter/xt_set.c:313 xt_check_target+0x3b5/0xa90 net/netfilter/x_tables.c:1038 nft_target_init+0x6a3/0xa20 net/netfilter/nft_compat.c:267 nf_tables_newexpr net/netfilter/nf_tables_api.c:3550 [inline] nf_tables_newrule+0x17ac/0x28b0 net/netfilter/nf_tables_api.c:4419 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:526 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:649 [inline] nfnetlink_rcv+0x1240/0x27b0 net/netfilter/nfnetlink.c:667 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x4d7/0x810 net/socket.c:2592 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: nfnl_subsys_ipset --> nlk_cb_mutex-NETFILTER --> &nft_net->commit_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&nft_net->commit_mutex); lock(nlk_cb_mutex-NETFILTER); lock(&nft_net->commit_mutex); lock(nfnl_subsys_ipset); *** DEADLOCK *** 1 lock held by syz.2.7962/13647: #0: ffff88804c36a4d8 (&nft_net->commit_mutex){+.+.}-{4:4}, at: nf_tables_valid_genid+0x3b/0x100 net/netfilter/nf_tables_api.c:11559 stack backtrace: CPU: 1 UID: 0 PID: 13647 Comm: syz.2.7962 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/13/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e1/0x300 kernel/locking/lockdep.c:2043 check_noncircular+0x12e/0x150 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x15a5/0x2cf0 kernel/locking/lockdep.c:5237 lock_acquire+0x106/0x330 kernel/locking/lockdep.c:5868 __mutex_lock_common kernel/locking/mutex.c:614 [inline] __mutex_lock+0x19f/0x1300 kernel/locking/mutex.c:776 ip_set_nfnl_get_byindex+0x67/0x230 net/netfilter/ipset/ip_set_core.c:909 set_target_v1_checkentry+0x8c/0x500 net/netfilter/xt_set.c:313 xt_check_target+0x3b5/0xa90 net/netfilter/x_tables.c:1038 nft_target_init+0x6a3/0xa20 net/netfilter/nft_compat.c:267 nf_tables_newexpr net/netfilter/nf_tables_api.c:3550 [inline] nf_tables_newrule+0x17ac/0x28b0 net/netfilter/nf_tables_api.c:4419 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:526 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:649 [inline] nfnetlink_rcv+0x1240/0x27b0 net/netfilter/nfnetlink.c:667 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x80f/0x9b0 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x813/0xb40 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:727 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:742 ____sys_sendmsg+0x4d7/0x810 net/socket.c:2592 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2646 __sys_sendmsg net/socket.c:2678 [inline] __do_sys_sendmsg net/socket.c:2683 [inline] __se_sys_sendmsg net/socket.c:2681 [inline] __x64_sys_sendmsg+0x1bd/0x2a0 net/socket.c:2681 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7faf31b9acb9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007faf32a61028 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007faf31e15fa0 RCX: 00007faf31b9acb9 RDX: 0000000000000800 RSI: 0000200000000100 RDI: 0000000000000003 RBP: 00007faf31c08bf7 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007faf31e16038 R14: 00007faf31e15fa0 R15: 00007ffd7be4b5c8 Cannot find add_set index 0 as target