netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel
authorPan Bian <bianpan2016@163.com>
Mon, 10 Dec 2018 13:39:37 +0000 (14:39 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:00:58 +0000 (10:00 +0100)
commite8267a5ec404913cd2fcfc51ff5e5b3671ed4916
tree1a7d09836b94d7b6a2a2311ede7523dde4833b4d
parent214b5617cc701471374f7ccfe748399f952646ec
netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel

[ Upstream commit 708abf74dd87f8640871b814faa195fb5970b0e3 ]

In the error handling block, nla_nest_cancel(skb, atd) is called to
cancel the nest operation. But then, ipset_nest_end(skb, atd) is
unexpected called to end the nest operation. This patch calls the
ipset_nest_end only on the branch that nla_nest_cancel is not called.

Fixes: 45040978c899 ("netfilter: ipset: Fix set:list type crash when flush/dump set in parallel")
Signed-off-by: Pan Bian <bianpan2016@163.com>
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_list_set.c