Skip to content

Commit 3f2fa28

Browse files
committed
netfilter: nf_tables: disallow timeout for anonymous sets
jira VULN-429 subsystem-sync netfilter:nf_tables 4.18.0-511 commit-author Pablo Neira Ayuso <[email protected]> commit e26d300 Never used from userspace, disallow these parameters. Signed-off-by: Pablo Neira Ayuso <[email protected]> (cherry picked from commit e26d300) Signed-off-by: Greg Rose <[email protected]>
1 parent c441e4d commit 3f2fa28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4164,6 +4164,10 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,
41644164
if (nla[NFTA_SET_GC_INTERVAL] != NULL) {
41654165
if (!(flags & NFT_SET_TIMEOUT))
41664166
return -EINVAL;
4167+
4168+
if (flags & NFT_SET_ANONYMOUS)
4169+
return -EOPNOTSUPP;
4170+
41674171
gc_int = ntohl(nla_get_be32(nla[NFTA_SET_GC_INTERVAL]));
41684172
}
41694173

@@ -5342,6 +5346,10 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
53425346
if (nla[NFTA_SET_ELEM_TIMEOUT] != NULL) {
53435347
if (!(set->flags & NFT_SET_TIMEOUT))
53445348
return -EINVAL;
5349+
5350+
if (flags & NFT_SET_ANONYMOUS)
5351+
return -EOPNOTSUPP;
5352+
53455353
err = nf_msecs_to_jiffies64(nla[NFTA_SET_ELEM_TIMEOUT],
53465354
&timeout);
53475355
if (err)

0 commit comments

Comments
 (0)