netfilter: nftables: fix possible double hook unregistration with table owner

Skip hook unregistration of owner tables from the netns exit path,
nft_rcv_nl_event() unregisters the table hooks before tearing down
the table content.

Fixes: 6001a930ce ("netfilter: nftables: introduce table ownership")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Pablo Neira Ayuso 2021-03-03 23:58:27 +01:00
parent 9cc0001a18
commit 2888b080d0

View File

@ -9028,8 +9028,12 @@ static void __nft_release_hooks(struct net *net)
{
struct nft_table *table;
list_for_each_entry(table, &net->nft.tables, list)
list_for_each_entry(table, &net->nft.tables, list) {
if (nft_table_has_owner(table))
continue;
__nft_release_hook(net, table);
}
}
static void __nft_release_table(struct net *net, struct nft_table *table)