Skip to content

Commit fc0ae52

Browse files
committed
netfilter: nf_tables: disallow NFT_SET_ELEM_CATCHALL and NFT_SET_ELEM_INTERVAL_END
These flags are mutually exclusive, report EINVAL in this case. Fixes: aaa3104 ("netfilter: nftables: add catch-all set element support") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 88cccd9 commit fc0ae52

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5198,6 +5198,9 @@ static int nft_setelem_parse_flags(const struct nft_set *set,
51985198
if (!(set->flags & NFT_SET_INTERVAL) &&
51995199
*flags & NFT_SET_ELEM_INTERVAL_END)
52005200
return -EINVAL;
5201+
if ((*flags & (NFT_SET_ELEM_INTERVAL_END | NFT_SET_ELEM_CATCHALL)) ==
5202+
(NFT_SET_ELEM_INTERVAL_END | NFT_SET_ELEM_CATCHALL))
5203+
return -EINVAL;
52015204

52025205
return 0;
52035206
}

0 commit comments

Comments
 (0)