]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: arp_tables: add pre_exit hook for table unregister
authorFlorian Westphal <fw@strlen.de>
Wed, 7 Apr 2021 19:43:40 +0000 (21:43 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 10 Apr 2021 19:18:24 +0000 (21:18 +0200)
commitf73ddeda6e6d3a2c0e3e920c943f07533c540b7a
treee8cd49d2df51c8418824ec07a858953c783454a4
parentf403c5962f5c5c376ba6b7fc3dd7421e3acd2ae9
netfilter: arp_tables: add pre_exit hook for table unregister

Same problem that also existed in iptables/ip(6)tables, when
arptable_filter is removed there is no longer a wait period before the
table/ruleset is free'd.

Unregister the hook in pre_exit, then remove the table in the exit
function.
This used to work correctly because the old nf_hook_unregister API
did unconditional synchronize_net.

The per-net hook unregister function uses call_rcu instead.

Fixes: d19b9b05b8e4 ("netfilter: xtables: don't hook tables by default")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter_arp/arp_tables.h
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/arptable_filter.c