Skip to content

Commit 5f4fc4b

Browse files
committed
netfilter: nf_tables: reject constant set with timeout
This set combination is weird: it allows for elements to be added/deleted, but once bound to the rule it cannot be updated anymore. Eventually, all elements expire, leading to an empty set which cannot be updated anymore. Reject this flags combination. Cc: stable@vger.kernel.org Fixes: 761da29 ("netfilter: nf_tables: add set timeout API support") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 1660360 commit 5f4fc4b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/netfilter/nf_tables_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,6 +5004,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
50045004
if ((flags & (NFT_SET_ANONYMOUS | NFT_SET_TIMEOUT | NFT_SET_EVAL)) ==
50055005
(NFT_SET_ANONYMOUS | NFT_SET_TIMEOUT))
50065006
return -EOPNOTSUPP;
5007+
if ((flags & (NFT_SET_CONSTANT | NFT_SET_TIMEOUT)) ==
5008+
(NFT_SET_CONSTANT | NFT_SET_TIMEOUT))
5009+
return -EOPNOTSUPP;
50075010
}
50085011

50095012
desc.dtype = 0;

0 commit comments

Comments
 (0)