Skip to content

Commit

Permalink
netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel
Browse files Browse the repository at this point in the history
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: 4504097 ("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>
  • Loading branch information
SinkFinder authored and ummakynes committed Dec 12, 2018
1 parent 530aad7 commit 708abf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/ipset/ip_set_list_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ list_set_list(const struct ip_set *set,
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;
Expand Down

0 comments on commit 708abf7

Please sign in to comment.