linux/net/ipv4/netfilter
Pablo Neira Ayuso 6eda0d771f netfilter: nat: use kfree_rcu to release ops
Florian Westphal says:

"Historically this is not an issue, even for normal base hooks: the data
path doesn't use the original nf_hook_ops that are used to register the
callbacks.

However, in v5.14 I added the ability to dump the active netfilter
hooks from userspace.

This code will peek back into the nf_hook_ops that are available
at the tail of the pointer-array blob used by the datapath.

The nat hooks are special, because they are called indirectly from
the central nat dispatcher hook. They are currently invisible to
the nfnl hook dump subsystem though.

But once that changes the nat ops structures have to be deferred too."

Update nf_nat_register_fn() to deal with partial exposition of the hooks
from error path which can be also an issue for nfnetlink_hook.

Fixes: e2cf17d377 ("netfilter: add new hook nfnl subsystem")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2026-04-20 23:45:41 +02:00
..
Kconfig netfilter: add back NETFILTER_XTABLES dependencies 2025-08-07 13:19:25 +02:00
Makefile
arp_tables.c netfilter: Use kmemdup_array instead of kmemdup for multiple allocation 2024-09-03 10:47:16 +02:00
arpt_mangle.c
arptable_filter.c
ip_tables.c netfilter: nf_dup{4, 6}: Move duplication check to task_struct 2025-05-23 13:57:12 +02:00
ipt_ECN.c
ipt_REJECT.c
ipt_SYNPROXY.c
ipt_ah.c
ipt_rpfilter.c ipv4: Convert ->flowi4_tos to dscp_t. 2025-08-26 17:34:31 -07:00
iptable_filter.c
iptable_mangle.c
iptable_nat.c netfilter: nat: use kfree_rcu to release ops 2026-04-20 23:45:41 +02:00
iptable_raw.c
iptable_security.c
nf_defrag_ipv4.c
nf_dup_ipv4.c ipv4: Convert ->flowi4_tos to dscp_t. 2025-08-26 17:34:31 -07:00
nf_nat_h323.c
nf_nat_pptp.c
nf_nat_snmp_basic.asn1
nf_nat_snmp_basic_main.c
nf_reject_ipv4.c ipv4: use dst4_mtu() instead of dst_mtu() 2026-02-02 17:49:29 -08:00
nf_socket_ipv4.c tcp: Don't pass hashinfo to socket lookup helpers. 2025-08-25 17:53:35 -07:00
nf_tproxy_ipv4.c tcp: Don't pass hashinfo to socket lookup helpers. 2025-08-25 17:53:35 -07:00
nft_dup_ipv4.c netfilter: nf_tables: remove register tracking infrastructure 2026-02-25 19:36:26 -08:00
nft_fib_ipv4.c netfilter: nf_tables: remove register tracking infrastructure 2026-02-25 19:36:26 -08:00
nft_reject_ipv4.c netfilter: nf_tables: remove register tracking infrastructure 2026-02-25 19:36:26 -08:00