Skip to content

Commit a8f8a4a

Browse files
ummakynessmb49
authored andcommitted
netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
BugLink: https://bugs.launchpad.net/bugs/2055145 [ Upstream commit 113661e ] It is still possible to set on the NFT_SET_CONCAT flag by specifying a set size and no field description, report EINVAL in such case. Fixes: 1b6345d ("netfilter: nf_tables: check NFT_SET_CONCAT flag if field_count is specified") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 310f6aa commit a8f8a4a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4703,8 +4703,12 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
47034703
if (err < 0)
47044704
return err;
47054705

4706-
if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT))
4706+
if (desc.field_count > 1) {
4707+
if (!(flags & NFT_SET_CONCAT))
4708+
return -EINVAL;
4709+
} else if (flags & NFT_SET_CONCAT) {
47074710
return -EINVAL;
4711+
}
47084712
} else if (flags & NFT_SET_CONCAT) {
47094713
return -EINVAL;
47104714
}

0 commit comments

Comments
 (0)