get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2230046/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2230046,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230046/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260429055529.104504-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": "<20260429055529.104504-2-pablo@netfilter.org>",
    "date": "2026-04-29T05:55:29",
    "name": "[nf,v2,2/2] netfilter: nft_compat: run checkentry() from .validate",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6f94ffa55a3dd389d9cfe9583ef382deba655d16",
    "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/20260429055529.104504-2-pablo@netfilter.org/mbox/",
    "series": [
        {
            "id": 501988,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501988/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=501988",
            "date": "2026-04-29T05:55:29",
            "name": "[nf,v2,1/2] netfilter: x_tables: add .check_hooks to matches and targets",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/501988/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2230046/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2230046/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-12280-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=AIAfzYwM;\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-12280-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=\"AIAfzYwM\"",
            "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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g564474Grz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 15:56:04 +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 333263037470\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 05:55:40 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 535C833DEDD;\n\tWed, 29 Apr 2026 05:55:39 +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 F3FB4299948\n\tfor <netfilter-devel@vger.kernel.org>; Wed, 29 Apr 2026 05:55:36 +0000 (UTC)",
            "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 102B9602A0;\n\tWed, 29 Apr 2026 07:55:35 +0200 (CEST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777442138; cv=none;\n b=YWuEsniWiS9a9U/Su4CWKv0GnFHbg+0XJuxiALkLjjAhJjZEtGVgtX1gw3mI+hAoLLWeTK4sJrb56WSjwhNmd415oAOolXhoeWV+7NbjG8b0IWiJp0QKrCPBXyq2BsoX3NN15nXrjkF3iy2SkuzjUl7bfYMv93BFkBpNXwGRVUU=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777442138; c=relaxed/simple;\n\tbh=JG42MYuECap9MeD+3XqztVYPkp8Vs1CXy8iMxFfJBjQ=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=YaqBSbiQXVXq2p8G1e/RSJO4XqH4yv/AcjI0UcXNrb32aMvEpua8UPs7TUOwPZOF9P/YWk71XUg3XFGZCnHmU+c9x4BLHgoyIMrdS3AUEqpabHke8e9ekoujIs9lR/K9TXpKII1cZt7fSrxn4rfFycwSD5oJdYpfDhWYiAs8T0k=",
        "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=AIAfzYwM; 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=1777442135;\n\tbh=RhANZcwapRweOFCO/gSCAmHoSRoWSiz8B5pj9xAsJDs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=AIAfzYwMhI5bPcsMQBfEzIgZTuRxwjR2L125ae/+IYJsgTpiglq/GBOUR5rCYeJLW\n\t h02tnD3DKyejBeFXUSREsTr5kPOTcrUb7vnjLC+MMrUACgV3INjZwBwnJNwlm6Q6lo\n\t mhq/74t0uzfS+GbN6BwMNjeLc5iUJ1X2JoPvJWDBdiwTX9vt9IReVsoRVekmZrV5Gm\n\t Yl/QBChBlPTJgH1TOqvFnpb1ikYolDG9E5iMb1X9oy7SDI1V3BikgFElz5hJZr2bi7\n\t dfyJzXm0SChXOkE0kdR2fXmPnqZNjmOlbe2zrGXX4ggiLdI2foseR4K3fKy3apZWXI\n\t feutDGZBuC3og==",
        "From": "Pablo Neira Ayuso <pablo@netfilter.org>",
        "To": "netfilter-devel@vger.kernel.org",
        "Cc": "fw@strlen.de",
        "Subject": "[PATCH nf,v2 2/2] netfilter: nft_compat: run checkentry() from\n .validate",
        "Date": "Wed, 29 Apr 2026 07:55:29 +0200",
        "Message-ID": "<20260429055529.104504-2-pablo@netfilter.org>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<20260429055529.104504-1-pablo@netfilter.org>",
        "References": "<20260429055529.104504-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---\nv2: - adjust commit description to current approach\n    - remove double check for nft_is_base_chain()\n    - propagate error in xt_check_hooks_target() call\n    - remove redudannt call to xt_check_hooks_{match,target}() from .init\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 \tv};\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",
        "2/2"
    ]
}