Skip to content

Commit 113661e

Browse files
committed
netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
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 <[email protected]>
1 parent 6b1ca88 commit 113661e

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
@@ -5070,8 +5070,12 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
50705070
if (err < 0)
50715071
return err;
50725072

5073-
if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT))
5073+
if (desc.field_count > 1) {
5074+
if (!(flags & NFT_SET_CONCAT))
5075+
return -EINVAL;
5076+
} else if (flags & NFT_SET_CONCAT) {
50745077
return -EINVAL;
5078+
}
50755079
} else if (flags & NFT_SET_CONCAT) {
50765080
return -EINVAL;
50775081
}

0 commit comments

Comments
 (0)