Skip to content

Commit e26d300

Browse files
committed
netfilter: nf_tables: disallow timeout for anonymous sets
Never used from userspace, disallow these parameters. Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent b770283 commit e26d300

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4909,6 +4909,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
49094909
if (!(flags & NFT_SET_TIMEOUT))
49104910
return -EINVAL;
49114911

4912+
if (flags & NFT_SET_ANONYMOUS)
4913+
return -EOPNOTSUPP;
4914+
49124915
err = nf_msecs_to_jiffies64(nla[NFTA_SET_TIMEOUT], &desc.timeout);
49134916
if (err)
49144917
return err;
@@ -4917,6 +4920,10 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
49174920
if (nla[NFTA_SET_GC_INTERVAL] != NULL) {
49184921
if (!(flags & NFT_SET_TIMEOUT))
49194922
return -EINVAL;
4923+
4924+
if (flags & NFT_SET_ANONYMOUS)
4925+
return -EOPNOTSUPP;
4926+
49204927
desc.gc_int = ntohl(nla_get_be32(nla[NFTA_SET_GC_INTERVAL]));
49214928
}
49224929

0 commit comments

Comments
 (0)