netfilter: ipset: Fix calling ip_set() macro at dumping
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Tue, 30 Oct 2018 21:43:42 +0000 (22:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Nov 2018 15:13:03 +0000 (16:13 +0100)
commit2f6bf7917f55f9dae913193e49672b3598620eab
tree98cde9881957ec7ad8fb2182f0148f8eb21f47ef
parente8b258ce87ff84ee967aad80095bc85dcc9db077
netfilter: ipset: Fix calling ip_set() macro at dumping

[ Upstream commit 8a02bdd50b2ecb6d62121d2958d3ea186cc88ce7 ]

The ip_set() macro is called when either ip_set_ref_lock held only
or no lock/nfnl mutex is held at dumping. Take this into account
properly. Also, use Pablo's suggestion to use rcu_dereference_raw(),
the ref_netlink protects the set.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/ipset/ip_set_core.c