Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2230347/?format=api
{ "id": 2230347, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230347/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260429152555.150390-2-pablo@netfilter.org/", "project": { "id": 26, "url": "http://patchwork.ozlabs.org/api/1.1/projects/26/?format=api", "name": "Netfilter Development", "link_name": "netfilter-devel", "list_id": "netfilter-devel.vger.kernel.org", "list_email": "netfilter-devel@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<20260429152555.150390-2-pablo@netfilter.org>", "date": "2026-04-29T15:25:55", "name": "[nf,v2,RESEND,2/2] netfilter: nft_compat: run checkentry() from .validate", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "25da6ab3e03ee6f46cc454271a4ddf0091dc61e3", "submitter": { "id": 1315, "url": "http://patchwork.ozlabs.org/api/1.1/people/1315/?format=api", "name": "Pablo Neira Ayuso", "email": "pablo@netfilter.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260429152555.150390-2-pablo@netfilter.org/mbox/", "series": [ { "id": 502095, "url": "http://patchwork.ozlabs.org/api/1.1/series/502095/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=502095", "date": "2026-04-29T15:25:54", "name": "[nf,v2,RESEND,1/2] netfilter: x_tables: add .check_hooks to matches and targets", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/502095/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2230347/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2230347/checks/", "tags": {}, "headers": { "Return-Path": "\n <netfilter-devel+bounces-12298-incoming=patchwork.ozlabs.org@vger.kernel.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "netfilter-devel@vger.kernel.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=netfilter.org header.i=@netfilter.org\n header.a=rsa-sha256 header.s=2025 header.b=SekMvTak;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12298-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=\"SekMvTak\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=217.70.190.124", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=netfilter.org" ], "Received": [ "from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5LlD4g7Qz1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 01:27:20 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id E4CA33006B63\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 15:26:13 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 2A94D37D11E;\n\tWed, 29 Apr 2026 15:26:11 +0000 (UTC)", "from mail.netfilter.org (mail.netfilter.org [217.70.190.124])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id C80BC2DCC01\n\tfor <netfilter-devel@vger.kernel.org>; Wed, 29 Apr 2026 15:26:02 +0000 (UTC)", "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 6BC336017D\n\tfor <netfilter-devel@vger.kernel.org>; Wed, 29 Apr 2026 17:26:00 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777476369; cv=none;\n b=H61qcrDIyoV5octqFEeUjU2B8mzFq4zi8KWcDKKT5WaXv7TPD2CVfTSJrTzFCsG3/wTf6QCqdEHoVckK989m9voMKISMRUqB5oB6N0nBUgIEWLIcqc2sv7ljTauOkW9yZtoOmdy+akcSWg2X24omxQhjMgPtxl9DJkLVrDHhu6U=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777476369; c=relaxed/simple;\n\tbh=Umcneb7Y//h078JMal5FI+uoQyv5I91mm6ubKzapc4c=;\n\th=From:To:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=VC5muvUsBKslZDyydan0eUHI19f4CCl0mnCAdxisNpcmqtluvOHCEyYL8E/paOPiTY0quG4nQWsXKcE6t8EgenL/v5H/C/CwDdz7AnpGsdnZ1uyw8T+S+CNt34DoSnl1C3r0CSi2Jug12S32lPAXTOcpCgmL1najYazDciSHEl4=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=netfilter.org;\n spf=pass smtp.mailfrom=netfilter.org;\n dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org\n header.b=SekMvTak; arc=none smtp.client-ip=217.70.190.124", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;\n\ts=2025; t=1777476360;\n\tbh=qrJtttSJRYPZaz5mS1g8li2PMSCTwS54f1THScU7C9A=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=SekMvTakE0MB/Sv6sHkKSG4BY0pTbNGkabZ4G+0Uuje9iA8ODGYONEQ86AIrfiZ0T\n\t Z72uLNycD5qpavwSNsUIkldpdDR05x4vWm1QWAj/hctlDZhaer15uA8FB8ENKIPOpm\n\t T7CRFbT6VX8ZBK8j1hrzvK6ecWUxXxFygs3s/vNctKOnPrAPKfwkcBc5jeXVxgIBWC\n\t yFaCgFtIfN4iVVKmarwhUQVhJabwhnlfOx9CJvzlsdSsjRDYhozB+XrpbjvJ6vcd/I\n\t cVHFZp74Bf1EgANQ00BmUuYNnORhl9hJ35n2q94wf6tqhd7inukKrtcudUmKlEPKB0\n\t VXVG6zknGlkjA==", "From": "Pablo Neira Ayuso <pablo@netfilter.org>", "To": "netfilter-devel@vger.kernel.org", "Subject": "[PATCH nf,v2 RESEND 2/2] netfilter: nft_compat: run checkentry() from\n .validate", "Date": "Wed, 29 Apr 2026 17:25:55 +0200", "Message-ID": "<20260429152555.150390-2-pablo@netfilter.org>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260429152555.150390-1-pablo@netfilter.org>", "References": "<20260429152555.150390-1-pablo@netfilter.org>", "Precedence": "bulk", "X-Mailing-List": "netfilter-devel@vger.kernel.org", "List-Id": "<netfilter-devel.vger.kernel.org>", "List-Subscribe": "<mailto:netfilter-devel+subscribe@vger.kernel.org>", "List-Unsubscribe": "<mailto:netfilter-devel+unsubscribe@vger.kernel.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "Several matches and one target check that the hook is correct from\ncheckentry(), however, the basechain is only available from\nnft_table_validate().\n\nThis patch uses .check_hooks() for matches and targets from the\nnft_compat expression .validate path.\n\nThis patch sets the table in the nft_ctx struct in nft_table_validate()\nwhich is required by this patch.\n\nBased on patch from Florian Westphal.\n\nFixes: 0ca743a55991 (\"netfilter: nf_tables: add compatibility layer for x_tables\")\nReported-by: Xiang Mei <xmei5@asu.edu>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\nresend of v2, sashiko failed to apply this v2 series, let's see if this\ngives it another chance to make it.\n\n net/netfilter/nf_tables_api.c | 1 +\n net/netfilter/nft_compat.c | 44 +++++++++++++++++++++++++++++------\n 2 files changed, 38 insertions(+), 7 deletions(-)", "diff": "diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c\nindex d20ce5c36d31..38e33c66c618 100644\n--- a/net/netfilter/nf_tables_api.c\n+++ b/net/netfilter/nf_tables_api.c\n@@ -4205,6 +4205,7 @@ static int nft_table_validate(struct net *net, const struct nft_table *table)\n \tstruct nft_chain *chain;\n \tstruct nft_ctx ctx = {\n \t\t.net\t= net,\n+\t\t.table\t= (struct nft_table *)table,\n \t\t.family\t= table->family,\n \t};\n \tint err = 0;\ndiff --git a/net/netfilter/nft_compat.c b/net/netfilter/nft_compat.c\nindex decc725a33c2..abdf3aad0928 100644\n--- a/net/netfilter/nft_compat.c\n+++ b/net/netfilter/nft_compat.c\n@@ -261,10 +261,10 @@ nft_target_init(const struct nft_ctx *ctx, const struct nft_expr *expr,\n \t\t\treturn ret;\n \t}\n \n-\tnft_target_set_tgchk_param(&par, ctx, target, info, &e, proto, inv);\n-\n \tnft_compat_wait_for_destructors(ctx->net);\n \n+\tnft_target_set_tgchk_param(&par, ctx, target, info, &e, proto, inv);\n+\n \tret = xt_check_target(&par, size, proto, inv);\n \tif (ret < 0) {\n \t\tif (ret == -ENOENT) {\n@@ -353,7 +353,6 @@ static int nft_target_dump(struct sk_buff *skb,\n static int nft_target_validate(const struct nft_ctx *ctx,\n \t\t\t const struct nft_expr *expr)\n {\n-\tstruct xt_target *target = expr->ops->data;\n \tunsigned int hook_mask = 0;\n \tint ret;\n \n@@ -377,11 +376,21 @@ static int nft_target_validate(const struct nft_ctx *ctx,\n \t\tconst struct nft_base_chain *basechain =\n \t\t\t\t\t\tnft_base_chain(ctx->chain);\n \t\tconst struct nf_hook_ops *ops = &basechain->ops;\n+\t\tstruct xt_target *target = expr->ops->data;\n+\t\tvoid *info = nft_expr_priv(expr);\n+\t\tstruct xt_tgchk_param par;\n+\t\tunion nft_entry e = {};\n \n \t\thook_mask = 1 << ops->hooknum;\n \t\tif (target->hooks && !(hook_mask & target->hooks))\n \t\t\treturn -EINVAL;\n \n+\t\tnft_target_set_tgchk_param(&par, ctx, target, info, &e, 0, false);\n+\n+\t\tret = xt_check_hooks_target(&par);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\n \t\tret = nft_compat_chain_validate_dependency(ctx, target->table);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n@@ -515,10 +524,10 @@ __nft_match_init(const struct nft_ctx *ctx, const struct nft_expr *expr,\n \t\t\treturn ret;\n \t}\n \n-\tnft_match_set_mtchk_param(&par, ctx, match, info, &e, proto, inv);\n-\n \tnft_compat_wait_for_destructors(ctx->net);\n \n+\tnft_match_set_mtchk_param(&par, ctx, match, info, &e, proto, inv);\n+\n \treturn xt_check_match(&par, size, proto, inv);\n }\n \n@@ -614,8 +623,6 @@ static int nft_match_large_dump(struct sk_buff *skb,\n static int nft_match_validate(const struct nft_ctx *ctx,\n \t\t\t const struct nft_expr *expr)\n {\n-\tstruct xt_match *match = expr->ops->data;\n-\tunsigned int hook_mask = 0;\n \tint ret;\n \n \tif (ctx->family != NFPROTO_IPV4 &&\n@@ -638,11 +645,34 @@ static int nft_match_validate(const struct nft_ctx *ctx,\n \t\tconst struct nft_base_chain *basechain =\n \t\t\t\t\t\tnft_base_chain(ctx->chain);\n \t\tconst struct nf_hook_ops *ops = &basechain->ops;\n+\t\tunsigned int hook_mask = 1 << ops->hooknum;\n+\t\tstruct xt_match *match = expr->ops->data;\n+\t\tsize_t size = XT_ALIGN(match->matchsize);\n+\t\tstruct xt_mtchk_param par;\n+\t\tunion nft_entry e = {};\n+\t\tvoid *info;\n \n \t\thook_mask = 1 << ops->hooknum;\n \t\tif (match->hooks && !(hook_mask & match->hooks))\n \t\t\treturn -EINVAL;\n \n+\t\tif (NFT_EXPR_SIZE(size) > NFT_MATCH_LARGE_THRESH) {\n+\t\t\tstruct nft_xt_match_priv *priv = nft_expr_priv(expr);\n+\n+\t\t\tinfo = priv->info;\n+\t\t} else {\n+\t\t\tinfo = nft_expr_priv(expr);\n+\t\t}\n+\n+\t\tif (match->hooks && !(hook_mask & match->hooks))\n+\t\t\treturn -EINVAL;\n+\n+\t\tnft_match_set_mtchk_param(&par, ctx, match, info, &e, 0, false);\n+\n+\t\tret = xt_check_hooks_match(&par);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n+\n \t\tret = nft_compat_chain_validate_dependency(ctx, match->table);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n", "prefixes": [ "nf", "v2", "RESEND", "2/2" ] }