Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2231775/?format=api
{ "id": 2231775, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2231775/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260501122237.296262-6-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": "<20260501122237.296262-6-pablo@netfilter.org>", "date": "2026-05-01T12:22:28", "name": "[net,05/14] netfilter: nft_compat: run xt_check_hooks_{match,target}() from .validate", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "9549f2d61e8abf8490568e999ad63c24b7c439c5", "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/20260501122237.296262-6-pablo@netfilter.org/mbox/", "series": [ { "id": 502449, "url": "http://patchwork.ozlabs.org/api/1.1/series/502449/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=502449", "date": "2026-05-01T12:22:23", "name": "[net,01/14] netfilter: replace skb_try_make_writable() by skb_ensure_writable()", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502449/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2231775/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2231775/checks/", "tags": {}, "headers": { "Return-Path": "\n <netfilter-devel+bounces-12378-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=cMALdZFB;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12378-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=\"cMALdZFB\"", "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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g6Vc42yJDz1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 22:25:08 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id A10BB303DD5C\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 1 May 2026 12:22:56 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id F12E33A254D;\n\tFri, 1 May 2026 12:22:55 +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 CFE443A16BE;\n\tFri, 1 May 2026 12:22:50 +0000 (UTC)", "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id B71F2600B9;\n\tFri, 1 May 2026 14:22:48 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777638175; cv=none;\n b=NOqMrV2YTDtHh1m+h+Q5dTN0oEH9Jk2cwcyQqRvaShTnjxw+NlZVPls1kNADHfNOUSerBhbX7HkkABpPEowMcqJJtpWRocJTWmXE2HZbFdxoM17XBBC64AhjnJPfJCi0HpHRpGuxcUfez0A2QM05V9LIJb+9rgQLkncIBsfiJMQ=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777638175; c=relaxed/simple;\n\tbh=VyKpaAA2RBDckXTxULVi0QivEocpX0HE9L2VwvwaSqY=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=KCQgzb9F7j/VpM3woPsSaKLEfOYLSjetVLQ9PMX8i/x43Xc5qYTSMxcjOqZRzWfg/90HjHoG5+vyzk9QTskCVdUzDdkZXJWdx5sZIGby8bgK9rrvC2I0imNT+goLH6etp42gpJ91NgllBiFCBmfBcy7Es0CDk/DURibbFrVlCxI=", "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=cMALdZFB; 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=1777638169;\n\tbh=8VOGzSuOdaTqtVdfry2eeLh+IQQSH9RU5psBadMOzPo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=cMALdZFBvrYUvCwSQMjGDqgvCnhgL8P64yH4GZlEmXlrCkGF5gL0gG2U+TCyt9Z4A\n\t n0GCc9UZKeU2oHlUrjjO7QW305M1SEvbTxgUVP0+Q+DCsPoWUeZnUFMKLz0Z4RZSz5\n\t IysjAe54GW2j4PqXzb6M4LwRKVWvhLB83tHCnlDTiS0Vh9srFv6CTE1N+jYINaf0+T\n\t cEMWMM50e22gC7TUuZ/Swf4KfhipmzMOa+9gJQ8aHddukECm0KGigk9wvAErNLtV0T\n\t WIcBBsENf9ANkQ0IAvB3Dw8bfbmGpwRhxoJ87KxDfl4PlT78m/PPPl8bHaN+Kz9b7B\n\t 05BJwaELi9GNw==", "From": "Pablo Neira Ayuso <pablo@netfilter.org>", "To": "netfilter-devel@vger.kernel.org", "Cc": "davem@davemloft.net,\n\tnetdev@vger.kernel.org,\n\tkuba@kernel.org,\n\tpabeni@redhat.com,\n\tedumazet@google.com,\n\tfw@strlen.de,\n\thorms@kernel.org", "Subject": "[PATCH net 05/14] netfilter: nft_compat: run\n xt_check_hooks_{match,target}() from .validate", "Date": "Fri, 1 May 2026 14:22:28 +0200", "Message-ID": "<20260501122237.296262-6-pablo@netfilter.org>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260501122237.296262-1-pablo@netfilter.org>", "References": "<20260501122237.296262-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 xt_check_hooks_{match,target}() from the nft_compat\nexpression .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---\n net/netfilter/nf_tables_api.c | 1 +\n net/netfilter/nft_compat.c | 45 +++++++++++++++++++++++++++--------\n 2 files changed, 36 insertions(+), 10 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..0caa9304d2d0 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,8 +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 \tif (ctx->family != NFPROTO_IPV4 &&\n@@ -377,11 +375,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\tunsigned int hook_mask = 1 << ops->hooknum;\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 +523,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 +622,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 +644,30 @@ 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\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": [ "net", "05/14" ] }