Skip to content

Commit bf6b3b6

Browse files
ummakynesgregkh
authored andcommitted
netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description
[ 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 <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 87e5fb6 commit bf6b3b6

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
@@ -5010,8 +5010,12 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
50105010
if (err < 0)
50115011
return err;
50125012

5013-
if (desc.field_count > 1 && !(flags & NFT_SET_CONCAT))
5013+
if (desc.field_count > 1) {
5014+
if (!(flags & NFT_SET_CONCAT))
5015+
return -EINVAL;
5016+
} else if (flags & NFT_SET_CONCAT) {
50145017
return -EINVAL;
5018+
}
50155019
} else if (flags & NFT_SET_CONCAT) {
50165020
return -EINVAL;
50175021
}

0 commit comments

Comments
 (0)