mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 13:27:06 +09:00
netfilter: nf_tables: disallow timeout for anonymous sets
commit e26d3009ef upstream.
Never used from userspace, disallow these parameters.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[Keerthana: code surrounding the patch is different
because nft_set_desc is not present in v4.19-v5.10]
Signed-off-by: Keerthana K <keerthana.kalyanasundaram@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f5450973eb
commit
49ce99ae43
@@ -3816,6 +3816,9 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,
|
||||
if (!(flags & NFT_SET_TIMEOUT))
|
||||
return -EINVAL;
|
||||
|
||||
if (flags & NFT_SET_ANONYMOUS)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
err = nf_msecs_to_jiffies64(nla[NFTA_SET_TIMEOUT], &timeout);
|
||||
if (err)
|
||||
return err;
|
||||
@@ -3824,6 +3827,10 @@ static int nf_tables_newset(struct net *net, struct sock *nlsk,
|
||||
if (nla[NFTA_SET_GC_INTERVAL] != NULL) {
|
||||
if (!(flags & NFT_SET_TIMEOUT))
|
||||
return -EINVAL;
|
||||
|
||||
if (flags & NFT_SET_ANONYMOUS)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
gc_int = ntohl(nla_get_be32(nla[NFTA_SET_GC_INTERVAL]));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user