netfilter: nf_tables: disallow timeout for anonymous sets
Subsystems (3)
PATCH 1/1 netfilter: nf_tables: disallow timeout for anonymous sets
From: Pablo Neira Ayuso <[email protected]>
commit e26d3009efda338f19016df4175f354a9bd0a4ab upstream.
Never used from userspace, disallow these parameters.
Signed-off-by Pablo Neira Ayuso <[email protected]>
[Keerthana: code surrounding the patch is different because nft_set_desc is not present in v4.19-v5.10]
Signed-off-by Keerthana K <[email protected]>
--- net/netfilter/nf_tables_api.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/netfilter/nf_tables_api.c +7 -0
@@ -3604,6 +3604,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;
@@ -3612,6 +3615,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 ])); }
Signature · 1 line
2.19.0
Greg KH
maintainerQuoted 6 lines · Keerthana K
From: Pablo Neira Ayuso <[email protected]>
commit
e26d3009efda338f19016df4175f354a9bd0a4abupstream.Never used from userspace, disallow these parameters.
Quoted 7 lines
Signed-off-by Pablo Neira Ayuso <[email protected]>[Keerthana: code surrounding the patch is different because
nft_set_descis not present in v4.19-v5.10]Signed-off-by Keerthana K <[email protected]>--- net/netfilter/nf_tables_api.c | 7 +++++++ 1 file changed, 7 insertions(+)
Now queued up, thanks.
greg k-h