From: Pablo Neira Ayuso Date: Fri, 16 Jun 2023 13:22:01 +0000 (+0200) Subject: netfilter: nf_tables: disallow updates of anonymous sets X-Git-Tag: v6.1.37~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abd3afddbf9ec41278c30486c20676c117498eef;p=platform%2Fkernel%2Flinux-starfive.git netfilter: nf_tables: disallow updates of anonymous sets [ Upstream commit b770283c98e0eee9133c47bc03b6cc625dc94723 ] Disallow updates of set timeout and garbage collection parameters for anonymous sets. Fixes: 123b99619cca ("netfilter: nf_tables: honor set timeout and garbage collection updates") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 984720964a49..7f71bdbc8267 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -4774,6 +4774,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info, if (info->nlh->nlmsg_flags & NLM_F_REPLACE) return -EOPNOTSUPP; + if (nft_set_is_anonymous(set)) + return -EOPNOTSUPP; + err = nft_set_expr_alloc(&ctx, set, nla, exprs, &num_exprs, flags); if (err < 0) return err;