Skip to content

Commit 13c6ba1

Browse files
author
Jozsef Kadlecsik
committed
netfilter: ipset: Fix the last missing check of nla_parse_deprecated()
In dump_init() the outdated comment was incorrect and we had a missing validation check of nla_parse_deprecated(). Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
1 parent f4f5748 commit 13c6ba1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/netfilter/ipset/ip_set_core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,11 +1293,13 @@ dump_init(struct netlink_callback *cb, struct ip_set_net *inst)
12931293
struct nlattr *attr = (void *)nlh + min_len;
12941294
u32 dump_type;
12951295
ip_set_id_t index;
1296+
int ret;
12961297

1297-
/* Second pass, so parser can't fail */
1298-
nla_parse_deprecated(cda, IPSET_ATTR_CMD_MAX, attr,
1299-
nlh->nlmsg_len - min_len, ip_set_setname_policy,
1300-
NULL);
1298+
ret = nla_parse_deprecated(cda, IPSET_ATTR_CMD_MAX, attr,
1299+
nlh->nlmsg_len - min_len,
1300+
ip_set_setname_policy, NULL);
1301+
if (ret)
1302+
return ret;
13011303

13021304
cb->args[IPSET_CB_PROTO] = nla_get_u8(cda[IPSET_ATTR_PROTOCOL]);
13031305
if (cda[IPSET_ATTR_SETNAME]) {

0 commit comments

Comments
 (0)