From: Pan Bian Date: Mon, 10 Dec 2018 13:39:37 +0000 (+0100) Subject: netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel X-Git-Tag: MMI-QSB30.62-17~983^2~44^2~88 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e8267a5ec404913cd2fcfc51ff5e5b3671ed4916;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c index 75d52aed6fdb..e563921e6af5 100644 --- a/net/netfilter/ipset/ip_set_list_set.c +++ b/net/netfilter/ipset/ip_set_list_set.c @@ -542,8 +542,8 @@ nla_put_failure: ret = -EMSGSIZE; } else { cb->args[IPSET_CB_ARG0] = i; + ipset_nest_end(skb, atd); } - ipset_nest_end(skb, atd); out: rcu_read_unlock(); return ret;