]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
parser_bison: only reset by name is supported by now
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 15 Jun 2025 09:34:11 +0000 (11:34 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 23 Jun 2025 16:41:05 +0000 (18:41 +0200)
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
tests/shell/testcases/bogons/nft-f/null_set_name_crash [new file with mode: 0644]

index ed6a24a15377a236904392837e185988225ba2ea..87b34293d22ce187eb1f7f2e908dadfa6553527f 100644 (file)
@@ -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 (file)
index 0000000..e5d85b2
--- /dev/null
@@ -0,0 +1,2 @@
+table y { }
+reset set y handle 6