netfilter: nf_tables: Fix for duplicate device in netdev hooks
authorPhil Sutter <phil@nwl.cc>
Thu, 5 Mar 2026 12:01:44 +0000 (13:01 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 10 Mar 2026 13:10:42 +0000 (14:10 +0100)
commitb7cdc5a97d02c943f4bdde4d5767ad0c13cad92b
tree75f1ebddf9cedf2ce7b72a213b56252dd6e12d10
parent6f1a9140ecda3baba3d945b9a6155af4268aafc4
netfilter: nf_tables: Fix for duplicate device in netdev hooks

When handling NETDEV_REGISTER notification, duplicate device
registration must be avoided since the device may have been added by
nft_netdev_hook_alloc() already when creating the hook.

Suggested-by: Florian Westphal <fw@strlen.de>
Reported-by: syzbot+bb9127e278fa198e110c@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=bb9127e278fa198e110c
Fixes: a331b78a5525 ("netfilter: nf_tables: Respect NETDEV_REGISTER events")
Tested-by: Helen Koike <koike@igalia.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_tables_api.c
net/netfilter/nft_chain_filter.c