public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, stable@vger.kernel.org, sashal@kernel.org
Subject: [PATCH -stable,4.14 08/11] netfilter: nft_dynset: do not reject set updates with NFT_SET_EVAL
Date: Sat, 27 May 2023 18:08:08 +0200	[thread overview]
Message-ID: <20230527160811.67779-9-pablo@netfilter.org> (raw)
In-Reply-To: <20230527160811.67779-1-pablo@netfilter.org>

[ 215a31f19dedd4e92a67cf5a9717ee898d012b3a ]

NFT_SET_EVAL is signalling the kernel that this sets can be updated from
the evaluation path, even if there are no expressions attached to the
element. Otherwise, set updates with no expressions fail. Update
description to describe the right semantics.

Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/uapi/linux/netfilter/nf_tables.h | 2 +-
 net/netfilter/nft_dynset.c               | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index 49b6997c3255..c7bb18ea4962 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -258,7 +258,7 @@ enum nft_rule_compat_attributes {
  * @NFT_SET_INTERVAL: set contains intervals
  * @NFT_SET_MAP: set is used as a dictionary
  * @NFT_SET_TIMEOUT: set uses timeouts
- * @NFT_SET_EVAL: set contains expressions for evaluation
+ * @NFT_SET_EVAL: set can be updated from the evaluation path
  * @NFT_SET_OBJECT: set contains stateful objects
  */
 enum nft_set_flags {
diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c
index f174a66bbc4b..d1dc5c8937a5 100644
--- a/net/netfilter/nft_dynset.c
+++ b/net/netfilter/nft_dynset.c
@@ -190,9 +190,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
 		priv->expr = nft_expr_init(ctx, tb[NFTA_DYNSET_EXPR]);
 		if (IS_ERR(priv->expr))
 			return PTR_ERR(priv->expr);
-
-	} else if (set->flags & NFT_SET_EVAL)
-		return -EINVAL;
+	}
 
 	nft_set_ext_prepare(&priv->tmpl);
 	nft_set_ext_add_length(&priv->tmpl, NFT_SET_EXT_KEY, set->klen);
-- 
2.30.2


  parent reply	other threads:[~2023-05-27 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-27 16:08 [PATCH -stable,4.14 00/11] more stable fixes for 4.14 Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 01/11] netfilter: nftables: add nft_parse_register_load() and use it Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 02/11] netfilter: nftables: add nft_parse_register_store() " Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 03/11] netfilter: nftables: statify nft_parse_register() Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 04/11] netfilter: nf_tables: validate registers coming from userspace Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 05/11] netfilter: nf_tables: add nft_setelem_parse_key() Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 06/11] netfilter: nf_tables: allow up to 64 bytes in the set element data area Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 07/11] netfilter: nf_tables: stricter validation of element data Pablo Neira Ayuso
2023-05-27 16:08 ` Pablo Neira Ayuso [this message]
2023-05-27 16:08 ` [PATCH -stable,4.14 09/11] netfilter: nf_tables: do not allow RULE_ID to refer to another chain Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 10/11] netfilter: nf_tables: do not allow SET_ID to refer to another table Pablo Neira Ayuso
2023-05-27 16:08 ` [PATCH -stable,4.14 11/11] netfilter: nf_tables: fix register ordering Pablo Neira Ayuso
2023-05-28  7:36 ` [PATCH -stable,4.14 00/11] more stable fixes for 4.14 Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230527160811.67779-9-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox