summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2018-12-10 14:39:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-13 09:50:59 +0100
commit9e404101601531ff9416d79eee37101ef694f0da (patch)
tree8cb25ce1166674df190750160e8305c4460ef7c1 /net
parent27f59f342f7c04a1f96f4b586d67e73b620f4f71 (diff)
downloadlinux-rpi3-9e404101601531ff9416d79eee37101ef694f0da.tar.gz
linux-rpi3-9e404101601531ff9416d79eee37101ef694f0da.tar.bz2
linux-rpi3-9e404101601531ff9416d79eee37101ef694f0da.zip
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>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/ipset/ip_set_list_set.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
index 4eef55da0878..8da228da53ae 100644
--- a/net/netfilter/ipset/ip_set_list_set.c
+++ b/net/netfilter/ipset/ip_set_list_set.c
@@ -531,8 +531,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;