diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-12-15 19:39:32 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-12-28 18:34:35 +0100 |
commit | df05ef874b284d833c2d9795a6350c6a373ab6c9 (patch) | |
tree | ffd2f14eaaebec6551de4e8e2fc1f19d9cb1ccf0 /net/ipv4 | |
parent | 26a4d063b1357e3ad81b776eb89d4d82f101da2c (diff) | |
download | op-kernel-dev-df05ef874b284d833c2d9795a6350c6a373ab6c9.zip op-kernel-dev-df05ef874b284d833c2d9795a6350c6a373ab6c9.tar.gz |
netfilter: nf_tables: release objects on netns destruction
We have to release the existing objects on netns removal otherwise we
leak them. Chains are unregistered in first place to make sure no
packets are walking on our rules and sets anymore.
The object release happens by when we unregister the family via
nft_release_afinfo() which is called from nft_unregister_afinfo() from
the corresponding __net_exit path in every family.
Reported-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/nf_tables_arp.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_tables_ipv4.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/netfilter/nf_tables_arp.c b/net/ipv4/netfilter/nf_tables_arp.c index 9d09d4f..cd84d42 100644 --- a/net/ipv4/netfilter/nf_tables_arp.c +++ b/net/ipv4/netfilter/nf_tables_arp.c @@ -57,7 +57,7 @@ err: static void nf_tables_arp_exit_net(struct net *net) { - nft_unregister_afinfo(net->nft.arp); + nft_unregister_afinfo(net, net->nft.arp); kfree(net->nft.arp); } diff --git a/net/ipv4/netfilter/nf_tables_ipv4.c b/net/ipv4/netfilter/nf_tables_ipv4.c index ca9dc3c..e44ba3b 100644 --- a/net/ipv4/netfilter/nf_tables_ipv4.c +++ b/net/ipv4/netfilter/nf_tables_ipv4.c @@ -78,7 +78,7 @@ err: static void nf_tables_ipv4_exit_net(struct net *net) { - nft_unregister_afinfo(net->nft.ipv4); + nft_unregister_afinfo(net, net->nft.ipv4); kfree(net->nft.ipv4); } |