Skip to content

Commit 0a49baa

Browse files
committed
netfilter: nf_tables: disallow timeout for anonymous sets
JIRA: https://issues.redhat.com/browse/RHEL-1720 JIRA: https://issues.redhat.com/browse/RHEL-1721 Upstream Status: commit e26d300 commit e26d300 Author: Pablo Neira Ayuso <pablo@netfilter.org> Date: Fri Jun 16 15:22:18 2023 +0200 netfilter: nf_tables: disallow timeout for anonymous sets Never used from userspace, disallow these parameters. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Florian Westphal <fwestpha@redhat.com>
1 parent ec166b7 commit 0a49baa

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
@@ -4659,6 +4659,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
46594659
if (!(flags & NFT_SET_TIMEOUT))
46604660
return -EINVAL;
46614661

4662+
if (flags & NFT_SET_ANONYMOUS)
4663+
return -EOPNOTSUPP;
4664+
46624665
err = nf_msecs_to_jiffies64(nla[NFTA_SET_TIMEOUT], &desc.timeout);
46634666
if (err)
46644667
return err;
@@ -4667,6 +4670,10 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
46674670
if (nla[NFTA_SET_GC_INTERVAL] != NULL) {
46684671
if (!(flags & NFT_SET_TIMEOUT))
46694672
return -EINVAL;
4673+
4674+
if (flags & NFT_SET_ANONYMOUS)
4675+
return -EOPNOTSUPP;
4676+
46704677
desc.gc_int = ntohl(nla_get_be32(nla[NFTA_SET_GC_INTERVAL]));
46714678
}
46724679

0 commit comments

Comments
 (0)