Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: cttimeout: decouple unlink and free on netns destruction

Make it so netns pre_exit unlinks the objects from the pernet list, so
they cannot be found anymore.

netns core issues a synchronize_rcu() before calling the exit hooks so
any the time the exit hooks run unconfirmed nf_conn entries have been
free'd or they have been committed to the hashtable.

The exit hook still tags unconfirmed entries as dying, this can
now be removed in a followup change.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
78222bac 1397af5b

+28 -10
-8
include/net/netfilter/nf_conntrack_timeout.h
··· 17 17 char data[]; 18 18 }; 19 19 20 - struct ctnl_timeout { 21 - struct list_head head; 22 - struct rcu_head rcu_head; 23 - refcount_t refcnt; 24 - char name[CTNL_TIMEOUT_NAME_MAX]; 25 - struct nf_ct_timeout timeout; 26 - }; 27 - 28 20 struct nf_conn_timeout { 29 21 struct nf_ct_timeout __rcu *timeout; 30 22 };