syzbot


possible deadlock in nfnl_lock

Status: upstream: reported on 2026/04/16 21:12
Reported-by: syzbot+a9ab45feff737e3ff03a@syzkaller.appspotmail.com
First crash: 6d19h, last: 6d19h
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 possible deadlock in nfnl_lock 4 C error 18 2159d 2298d 0/1 upstream: reported C repro on 2020/01/07 11:25

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.6.1946/11554 is trying to acquire lock:
ffff80001c87d178 (nfnl_subsys_ipset){+.+.}-{3:3}, at: nfnl_lock+0x50/0x78 net/netfilter/nfnetlink.c:98

but task is already holding lock:
ffff0000d17bfab8 (&nft_net->commit_mutex){+.+.}-{3:3}, at: nf_tables_valid_genid+0x44/0x11c net/netfilter/nf_tables_api.c:10232

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&nft_net->commit_mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
       nf_tables_dumpreset_obj+0x78/0xa8 net/netfilter/nf_tables_api.c:7511
       netlink_dump+0x570/0xb18 net/netlink/af_netlink.c:2236
       __netlink_dump_start+0x47c/0x698 net/netlink/af_netlink.c:2338
       netlink_dump_start include/linux/netlink.h:269 [inline]
       nft_netlink_dump_start_rcu+0xec/0x1a8 net/netfilter/nf_tables_api.c:1089
       nf_tables_getobj_reset+0x188/0x534 net/netfilter/nf_tables_api.c:7646
       nfnetlink_rcv_msg+0x6d4/0xfac net/netfilter/nfnetlink.c:290
       netlink_rcv_skb+0x218/0x3e8 net/netlink/af_netlink.c:2511
       nfnetlink_rcv+0x214/0x1bfc net/netfilter/nfnetlink.c:659
       netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
       netlink_unicast+0x60c/0x814 net/netlink/af_netlink.c:1344
       netlink_sendmsg+0x6f4/0x9c0 net/netlink/af_netlink.c:1872
       sock_sendmsg_nosec net/socket.c:718 [inline]
       __sock_sendmsg net/socket.c:730 [inline]
       ____sys_sendmsg+0x5c8/0x938 net/socket.c:2518
       ___sys_sendmsg net/socket.c:2572 [inline]
       __sys_sendmsg+0x288/0x374 net/socket.c:2601
       __do_sys_sendmsg net/socket.c:2610 [inline]
       __se_sys_sendmsg net/socket.c:2608 [inline]
       __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2608
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #1 (nlk_cb_mutex-NETFILTER){+.+.}-{3:3}:
       __mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
       __netlink_dump_start+0x104/0x698 net/netlink/af_netlink.c:2305
       netlink_dump_start include/linux/netlink.h:269 [inline]
       ip_set_dump+0x130/0x1b8 net/netfilter/ipset/ip_set_core.c:1719
       nfnetlink_rcv_msg+0xad0/0xfac net/netfilter/nfnetlink.c:302
       netlink_rcv_skb+0x218/0x3e8 net/netlink/af_netlink.c:2511
       nfnetlink_rcv+0x214/0x1bfc net/netfilter/nfnetlink.c:659
       netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
       netlink_unicast+0x60c/0x814 net/netlink/af_netlink.c:1344
       netlink_sendmsg+0x6f4/0x9c0 net/netlink/af_netlink.c:1872
       sock_sendmsg_nosec net/socket.c:718 [inline]
       __sock_sendmsg net/socket.c:730 [inline]
       ____sys_sendmsg+0x5c8/0x938 net/socket.c:2518
       ___sys_sendmsg net/socket.c:2572 [inline]
       __sys_sendmsg+0x288/0x374 net/socket.c:2601
       __do_sys_sendmsg net/socket.c:2610 [inline]
       __se_sys_sendmsg net/socket.c:2608 [inline]
       __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2608
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

-> #0 (nfnl_subsys_ipset){+.+.}-{3:3}:
       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+0x2880/0x6800 kernel/locking/lockdep.c:5049
       lock_acquire+0x20c/0x63c kernel/locking/lockdep.c:5662
       __mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
       __mutex_lock kernel/locking/mutex.c:747 [inline]
       mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
       nfnl_lock+0x50/0x78 net/netfilter/nfnetlink.c:98
       ip_set_nfnl_get_byindex+0x7c/0x258 net/netfilter/ipset/ip_set_core.c:911
       set_match_v1_checkentry+0x70/0x228 net/netfilter/xt_set.c:139
       xt_check_match+0x3d8/0xa48 net/netfilter/x_tables.c:534
       __nft_match_init+0x508/0x6d8 net/netfilter/nft_compat.c:522
       nft_match_init+0x38/0x4c net/netfilter/nft_compat.c:529
       nf_tables_newexpr net/netfilter/nf_tables_api.c:3065 [inline]
       nf_tables_newrule+0x1174/0x1b70 net/netfilter/nf_tables_api.c:3792
       nfnetlink_rcv_batch net/netfilter/nfnetlink.c:519 [inline]
       nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:639 [inline]
       nfnetlink_rcv+0xc7c/0x1bfc net/netfilter/nfnetlink.c:657
       netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
       netlink_unicast+0x60c/0x814 net/netlink/af_netlink.c:1344
       netlink_sendmsg+0x6f4/0x9c0 net/netlink/af_netlink.c:1872
       sock_sendmsg_nosec net/socket.c:718 [inline]
       __sock_sendmsg net/socket.c:730 [inline]
       ____sys_sendmsg+0x5c8/0x938 net/socket.c:2518
       ___sys_sendmsg net/socket.c:2572 [inline]
       __sys_sendmsg+0x288/0x374 net/socket.c:2601
       __do_sys_sendmsg net/socket.c:2610 [inline]
       __se_sys_sendmsg net/socket.c:2608 [inline]
       __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2608
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
       el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
       do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
       el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585

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.6.1946/11554:
 #0: ffff0000d17bfab8 (&nft_net->commit_mutex){+.+.}-{3:3}, at: nf_tables_valid_genid+0x44/0x11c net/netfilter/nf_tables_api.c:10232

stack backtrace:
CPU: 1 PID: 11554 Comm: syz.6.1946 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/26/2026
Call trace:
 dump_backtrace+0x1c0/0x1ec arch/arm64/kernel/stacktrace.c:158
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf4/0x15c lib/dump_stack.c:106
 dump_stack+0x1c/0x5c lib/dump_stack.c:113
 print_circular_bug+0x148/0x1b0 kernel/locking/lockdep.c:2048
 check_noncircular+0x264/0x2f8 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+0x2880/0x6800 kernel/locking/lockdep.c:5049
 lock_acquire+0x20c/0x63c kernel/locking/lockdep.c:5662
 __mutex_lock_common+0x190/0x1f60 kernel/locking/mutex.c:603
 __mutex_lock kernel/locking/mutex.c:747 [inline]
 mutex_lock_nested+0x38/0x44 kernel/locking/mutex.c:799
 nfnl_lock+0x50/0x78 net/netfilter/nfnetlink.c:98
 ip_set_nfnl_get_byindex+0x7c/0x258 net/netfilter/ipset/ip_set_core.c:911
 set_match_v1_checkentry+0x70/0x228 net/netfilter/xt_set.c:139
 xt_check_match+0x3d8/0xa48 net/netfilter/x_tables.c:534
 __nft_match_init+0x508/0x6d8 net/netfilter/nft_compat.c:522
 nft_match_init+0x38/0x4c net/netfilter/nft_compat.c:529
 nf_tables_newexpr net/netfilter/nf_tables_api.c:3065 [inline]
 nf_tables_newrule+0x1174/0x1b70 net/netfilter/nf_tables_api.c:3792
 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:519 [inline]
 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:639 [inline]
 nfnetlink_rcv+0xc7c/0x1bfc net/netfilter/nfnetlink.c:657
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x60c/0x814 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x6f4/0x9c0 net/netlink/af_netlink.c:1872
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x5c8/0x938 net/socket.c:2518
 ___sys_sendmsg net/socket.c:2572 [inline]
 __sys_sendmsg+0x288/0x374 net/socket.c:2601
 __do_sys_sendmsg net/socket.c:2610 [inline]
 __se_sys_sendmsg net/socket.c:2608 [inline]
 __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2608
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b4 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140
 do_el0_svc+0x58/0x130 arch/arm64/kernel/syscall.c:204
 el0_svc+0x58/0x128 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585
Cannot find set identified by id 0 to match

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/04/16 21:11 linux-6.1.y 8e8fc038cad5 4743f87d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 possible deadlock in nfnl_lock
* Struck through repros no longer work on HEAD.