netfilter: nf_tables: register hooks last when adding new chain/flowtable
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 19 Feb 2024 18:43:53 +0000 (19:43 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 21 Feb 2024 23:14:54 +0000 (00:14 +0100)
commitd472e9853d7b46a6b094224d131d09ccd3a03daf
tree90d83156a9ddeadbcf994a98625584287ce950c3
parent8762785f459be1cfe6fcf7285c123aad6a3703f0
netfilter: nf_tables: register hooks last when adding new chain/flowtable

Register hooks last when adding chain/flowtable to ensure that packets do
not walk over datastructure that is being released in the error path
without waiting for the rcu grace period.

Fixes: 91c7b38dc9f0 ("netfilter: nf_tables: use new transaction infrastructure to handle chain")
Fixes: 3b49e2e94e6e ("netfilter: nf_tables: add flow table netlink frontend")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c