netfilter: ipt_CLUSTERIP: put config instead of freeing it
authorFlorian Westphal <fw@strlen.de>
Fri, 16 Feb 2018 11:49:33 +0000 (12:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:52:03 +0000 (07:52 +0200)
commit84fc57f472f9fcf42ba3ef27734694d1a2a75b23
tree73cbaac505fe0d6b1b2af87e1c2781752c7a4b63
parent596816fabe42d41d81e862b056761bab50a93ae2
netfilter: ipt_CLUSTERIP: put config instead of freeing it

[ Upstream commit 1a9da5937386dbe553ffcf6c65d985bd48c347c5 ]

Once struct is added to per-netns list it becomes visible to other cpus,
so we cannot use kfree().

Also delay setting entries refcount to 1 until after everything is
initialised so that when we call clusterip_config_put() in this spot
entries is still zero.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/netfilter/ipt_CLUSTERIP.c