Skip to content

Commit 1660360

Browse files
committed
netfilter: nf_tables: disallow anonymous set with timeout flag
Anonymous sets are never used with timeout from userspace, reject this. Exception to this rule is NFT_SET_EVAL to ensure legacy meters still work. Cc: [email protected] Fixes: 761da29 ("netfilter: nf_tables: add set timeout API support") Reported-by: lonial con <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent c055fc0 commit 1660360

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
@@ -5001,6 +5001,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
50015001
if ((flags & (NFT_SET_EVAL | NFT_SET_OBJECT)) ==
50025002
(NFT_SET_EVAL | NFT_SET_OBJECT))
50035003
return -EOPNOTSUPP;
5004+
if ((flags & (NFT_SET_ANONYMOUS | NFT_SET_TIMEOUT | NFT_SET_EVAL)) ==
5005+
(NFT_SET_ANONYMOUS | NFT_SET_TIMEOUT))
5006+
return -EOPNOTSUPP;
50045007
}
50055008

50065009
desc.dtype = 0;

0 commit comments

Comments
 (0)