UPSTREAM: netfilter: nf_tables: disallow timeout for anonymous sets
commit e26d3009efda338f19016df4175f354a9bd0a4ab upstream. Never used from userspace, disallow these parameters. Bug: 329205828 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit b7be6c737a179a76901c872f6b4c1d00552d9a1b) Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: I3d8358a6dee3246e3ac56697dbb2be8fdc5f716f
This commit is contained in:
parent
4a85f45e4e
commit
a69447d296
@ -4741,6 +4741,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
|
||||
if (!(flags & NFT_SET_TIMEOUT))
|
||||
return -EINVAL;
|
||||
|
||||
if (flags & NFT_SET_ANONYMOUS)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
err = nf_msecs_to_jiffies64(nla[NFTA_SET_TIMEOUT], &desc.timeout);
|
||||
if (err)
|
||||
return err;
|
||||
@ -4749,6 +4752,10 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,
|
||||
if (nla[NFTA_SET_GC_INTERVAL] != NULL) {
|
||||
if (!(flags & NFT_SET_TIMEOUT))
|
||||
return -EINVAL;
|
||||
|
||||
if (flags & NFT_SET_ANONYMOUS)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
desc.gc_int = ntohl(nla_get_be32(nla[NFTA_SET_GC_INTERVAL]));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user