]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netfilter: nf_tables: remove redundant chain validation on register store
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 19 Nov 2025 12:42:05 +0000 (13:42 +0100)
committerFlorian Westphal <fw@strlen.de>
Thu, 11 Dec 2025 12:08:43 +0000 (13:08 +0100)
This validation predates the introduction of the state machine that
determines when to enter slow path validation for error reporting.

Currently, table validation is perform when:

- new rule contains expressions that need validation.
- new set element with jump/goto verdict.

Validation on register store skips most checks with no basechains, still
this walks the graph searching for loops and ensuring expressions are
called from the right hook. Remove this.

Fixes: a654de8fdc18 ("netfilter: nf_tables: fix chain dependency validation")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_tables_api.c

index f3de2f9bbebf11f0817fc21d3435953d3db51359..c46b1bb0efe0f1fcf28400f0cb3a1336290aadab 100644 (file)
@@ -11676,21 +11676,10 @@ static int nft_validate_register_store(const struct nft_ctx *ctx,
                                       enum nft_data_types type,
                                       unsigned int len)
 {
-       int err;
-
        switch (reg) {
        case NFT_REG_VERDICT:
                if (type != NFT_DATA_VERDICT)
                        return -EINVAL;
-
-               if (data != NULL &&
-                   (data->verdict.code == NFT_GOTO ||
-                    data->verdict.code == NFT_JUMP)) {
-                       err = nft_chain_validate(ctx, data->verdict.chain);
-                       if (err < 0)
-                               return err;
-               }
-
                break;
        default:
                if (type != NFT_DATA_VALUE)