From: Patrick McHardy Date: Mon, 5 Dec 2005 21:36:50 +0000 (-0800) Subject: [NETFILTER]: Wait for untracked references in nf_conntrack module unload X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6636568cf85ef5898a892e90fcc88b61cca9ca27;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [NETFILTER]: Wait for untracked references in nf_conntrack module unload Noticed by Pablo Neira . Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 1da678303d7..a7c7b490cf2 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -1383,6 +1383,9 @@ void nf_conntrack_cleanup(void) schedule(); goto i_see_dead_people; } + /* wait until all references to nf_conntrack_untracked are dropped */ + while (atomic_read(&nf_conntrack_untracked.ct_general.use) > 1) + schedule(); for (i = 0; i < NF_CT_F_NUM; i++) { if (nf_ct_cache[i].use == 0)