]> granicus.if.org Git - ipset/commitdiff
netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel
authorPan Bian <bianpan2016@163.com>
Mon, 26 Nov 2018 10:42:10 +0000 (18:42 +0800)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Wed, 28 Nov 2018 17:23:23 +0000 (18:23 +0100)
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: 45040978c89("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>
kernel/net/netfilter/ipset/ip_set_list_set.c

index 4a744a559f20663e10d05598769f2fb34e6e91a8..60925f7295424d273cc3c0c6dda43ef81d084f2c 100644 (file)
@@ -533,8 +533,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;