All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 4/5] parser_bison: only reset by name is supported by now
Date: Sun, 15 Jun 2025 12:00:18 +0200	[thread overview]
Message-ID: <20250615100019.2988872-5-pablo@netfilter.org> (raw)
In-Reply-To: <20250615100019.2988872-1-pablo@netfilter.org>

NFT_MSG_GETSET does not support for handle lookup yet, restrict this to
reset by name by now.

Add a bogon test reported by Florian Westphal.

Fixes: 83e0f4402fb7 ("Implement 'reset {set,map,element}' commands")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/parser_bison.y                                     | 4 ++--
 tests/shell/testcases/bogons/nft-f/null_set_name_crash | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
 create mode 100644 tests/shell/testcases/bogons/nft-f/null_set_name_crash

diff --git a/src/parser_bison.y b/src/parser_bison.y
index ed6a24a15377..87b34293d22c 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1757,11 +1757,11 @@ reset_cmd		:	COUNTERS	list_cmd_spec_any
 			{
 				$$ = cmd_alloc(CMD_RESET, CMD_OBJ_ELEMENTS, &$2, &@$, $3);
 			}
-			|	SET		set_or_id_spec
+			|	SET		set_spec
 			{
 				$$ = cmd_alloc(CMD_RESET, CMD_OBJ_SET, &$2, &@$, NULL);
 			}
-			|	MAP		set_or_id_spec
+			|	MAP		set_spec
 			{
 				$$ = cmd_alloc(CMD_RESET, CMD_OBJ_MAP, &$2, &@$, NULL);
 			}
diff --git a/tests/shell/testcases/bogons/nft-f/null_set_name_crash b/tests/shell/testcases/bogons/nft-f/null_set_name_crash
new file mode 100644
index 000000000000..e5d85b228a84
--- /dev/null
+++ b/tests/shell/testcases/bogons/nft-f/null_set_name_crash
@@ -0,0 +1,2 @@
+table y { }
+reset set y handle 6
-- 
2.30.2


  parent reply	other threads:[~2025-06-15 10:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-15 10:00 [PATCH nft 0/5] assorted updates and fixes Pablo Neira Ayuso
2025-06-15 10:00 ` [PATCH nft 1/5] rule: skip fuzzy lookup if object name is not available Pablo Neira Ayuso
2025-06-15 10:00 ` [PATCH nft 2/5] cache: assert name is non-nul when looking up Pablo Neira Ayuso
2025-06-15 10:00 ` [PATCH nft 3/5] cache: pass name to cache_add() Pablo Neira Ayuso
2025-06-15 10:00 ` Pablo Neira Ayuso [this message]
2025-06-15 10:00 ` [PATCH nft 5/5] parser_bison: allow delete command with map via handle Pablo Neira Ayuso
2025-06-23 17:08 ` [PATCH nft 0/5] assorted updates and fixes Pablo Neira Ayuso

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=20250615100019.2988872-5-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.