get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216148,
    "url": "http://patchwork.ozlabs.org/api/patches/2216148/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325222615.637793-12-pablo@netfilter.org/",
    "project": {
        "id": 26,
        "url": "http://patchwork.ozlabs.org/api/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260325222615.637793-12-pablo@netfilter.org>",
    "list_archive_url": null,
    "date": "2026-03-25T22:26:12",
    "name": "[net,11/14] netfilter: nf_conntrack_expect: store netns and zone in expectation",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": true,
    "hash": "606a266684f851b0fb3f3842369d02fa9de4060b",
    "submitter": {
        "id": 1315,
        "url": "http://patchwork.ozlabs.org/api/people/1315/?format=api",
        "name": "Pablo Neira Ayuso",
        "email": "pablo@netfilter.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325222615.637793-12-pablo@netfilter.org/mbox/",
    "series": [
        {
            "id": 497517,
            "url": "http://patchwork.ozlabs.org/api/series/497517/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=497517",
            "date": "2026-03-25T22:26:01",
            "name": "[net,01/14] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/497517/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216148/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216148/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-11431-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=C8v9DLR/;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11431-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=\"C8v9DLR/\"",
            "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 tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::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 4fh1km3XPSz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 09:28:00 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id D45C730707BB\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 22:26:58 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 18B6B38AC98;\n\tWed, 25 Mar 2026 22:26:42 +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 27B69371D0E;\n\tWed, 25 Mar 2026 22:26:40 +0000 (UTC)",
            "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 209FA6017D;\n\tWed, 25 Mar 2026 23:26:38 +0100 (CET)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774477601; cv=none;\n b=Lfu1IgQ3jEebGzva6tMNPOC3J6ItVNiM6sZ06C0pIyhBYhKqgcb2yqAdx5vadZXzsbJ6MgSbvsrHPbZ972FNPxiVvpoX+4alsyILz7iyHtj82Nbue7Te/zjekc05KjOENE+mytMTmj1oi/sGzCrTx5NQWogVP4slmIjmOUTPkfQ=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774477601; c=relaxed/simple;\n\tbh=tEyzgpBl6untVBoLfLqJ7aRUslMYGDD6YmvDurlq/tg=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=mJKqUykmYkS0QNssHeilGxNAWkEMeSL11H6i3igTYxWzw2RC1scY7ad5Gq2JtBTzuZcM1SUQwmj89osNLU6zDHagqpJ6Iclu5aJoKVU+p+CfBE/5wV2jemU+LRFs/tcvhQosmGXnpuWbLRyvzrTQtwRWe7Xk0QSAR2FY+FYcZlI=",
        "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=C8v9DLR/; 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=1774477598;\n\tbh=Jieo/3if9WncjG+80KJlCXCChmQ3rYE4ZAyLUHFPIK8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=C8v9DLR/c7NJwAv9Uj7M7W+oQzOfKSHoCrPIGqZF04ctKOBBFqv+ActqUb+frDXoY\n\t cg7vV0t3Estp6g34q/X+cRXFqohUXOwr9VzkXWXTjM+5nebyudw8mdup8FRh7H+Jue\n\t tbwJmMX9pvHjkF5tTpPhy/buOWCvc3IdIGbx93hVaaDjclo3vCL7azjX4m08n8aYWQ\n\t my5m4JVtvHsg6AVcucKD8rktHwYPS0/3Y3yGQsGDSgor9gFcq8ofJ5jtaFTUaLzTKZ\n\t M0lacTwKgH7xUXCCYmLMAD2wzhPmn6wJH1r3ydtQyrewqKoQK0+1NdXpwqEzSJCeS+\n\t PtyeZvIbrTfRQ==",
        "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 11/14] netfilter: nf_conntrack_expect: store netns and\n zone in expectation",
        "Date": "Wed, 25 Mar 2026 23:26:12 +0100",
        "Message-ID": "<20260325222615.637793-12-pablo@netfilter.org>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<20260325222615.637793-1-pablo@netfilter.org>",
        "References": "<20260325222615.637793-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": "__nf_ct_expect_find() and nf_ct_expect_find_get() are called under\nrcu_read_lock() but they dereference the master conntrack via\nexp->master.\n\nSince the expectation does not hold a reference on the master conntrack,\nthis could be dying conntrack or different recycled conntrack than the\nreal master due to SLAB_TYPESAFE_RCU.\n\nStore the netns, the master_tuple and the zone in struct\nnf_conntrack_expect as a safety measure.\n\nThis patch is required by the follow up fix not to dump expectations\nthat do not belong to this netns.\n\nSigned-off-by: Florian Westphal <fw@strlen.de>\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n include/net/netfilter/nf_conntrack_expect.h | 18 +++++++++++++++++-\n net/netfilter/nf_conntrack_expect.c         |  7 +++++--\n net/netfilter/nf_conntrack_netlink.c        |  3 +++\n 3 files changed, 25 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h\nindex 1b01400b10bd..e9a8350e7ccf 100644\n--- a/include/net/netfilter/nf_conntrack_expect.h\n+++ b/include/net/netfilter/nf_conntrack_expect.h\n@@ -22,10 +22,16 @@ struct nf_conntrack_expect {\n \t/* Hash member */\n \tstruct hlist_node hnode;\n \n+\t/* Network namespace */\n+\tpossible_net_t net;\n+\n \t/* We expect this tuple, with the following mask */\n \tstruct nf_conntrack_tuple tuple;\n \tstruct nf_conntrack_tuple_mask mask;\n \n+#ifdef CONFIG_NF_CONNTRACK_ZONES\n+\tstruct nf_conntrack_zone zone;\n+#endif\n \t/* Usage count. */\n \trefcount_t use;\n \n@@ -62,7 +68,17 @@ struct nf_conntrack_expect {\n \n static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp)\n {\n-\treturn nf_ct_net(exp->master);\n+\treturn read_pnet(&exp->net);\n+}\n+\n+static inline bool nf_ct_exp_zone_equal_any(const struct nf_conntrack_expect *a,\n+\t\t\t\t\t    const struct nf_conntrack_zone *b)\n+{\n+#ifdef CONFIG_NF_CONNTRACK_ZONES\n+\treturn a->zone.id == b->id;\n+#else\n+\treturn true;\n+#endif\n }\n \n #define NF_CT_EXP_POLICY_NAME_LEN\t16\ndiff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c\nindex 1cbe5f1108c2..29b9d984a990 100644\n--- a/net/netfilter/nf_conntrack_expect.c\n+++ b/net/netfilter/nf_conntrack_expect.c\n@@ -113,8 +113,8 @@ nf_ct_exp_equal(const struct nf_conntrack_tuple *tuple,\n \t\tconst struct net *net)\n {\n \treturn nf_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask) &&\n-\t       net_eq(net, nf_ct_net(i->master)) &&\n-\t       nf_ct_zone_equal_any(i->master, zone);\n+\t       net_eq(net, read_pnet(&i->net)) &&\n+\t       nf_ct_exp_zone_equal_any(i, zone);\n }\n \n bool nf_ct_remove_expect(struct nf_conntrack_expect *exp)\n@@ -326,6 +326,7 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,\n {\n \tstruct nf_conntrack_helper *helper = NULL;\n \tstruct nf_conn *ct = exp->master;\n+\tstruct net *net = read_pnet(&ct->ct_net);\n \tstruct nf_conn_help *help;\n \tint len;\n \n@@ -343,6 +344,8 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,\n \t\thelper = rcu_dereference(help->helper);\n \n \trcu_assign_pointer(exp->helper, helper);\n+\twrite_pnet(&exp->net, net);\n+\texp->zone = ct->zone;\n \texp->tuple.src.l3num = family;\n \texp->tuple.dst.protonum = proto;\n \ndiff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c\nindex 89540112d165..2ec33c0518e9 100644\n--- a/net/netfilter/nf_conntrack_netlink.c\n+++ b/net/netfilter/nf_conntrack_netlink.c\n@@ -3538,6 +3538,7 @@ ctnetlink_alloc_expect(const struct nlattr * const cda[], struct nf_conn *ct,\n \t\t       struct nf_conntrack_tuple *tuple,\n \t\t       struct nf_conntrack_tuple *mask)\n {\n+\tstruct net *net = read_pnet(&ct->ct_net);\n \tstruct nf_conntrack_expect *exp;\n \tstruct nf_conn_help *help;\n \tu32 class = 0;\n@@ -3577,6 +3578,8 @@ ctnetlink_alloc_expect(const struct nlattr * const cda[], struct nf_conn *ct,\n \n \texp->class = class;\n \texp->master = ct;\n+\twrite_pnet(&exp->net, net);\n+\texp->zone = ct->zone;\n \tif (!helper)\n \t\thelper = rcu_dereference(help->helper);\n \trcu_assign_pointer(exp->helper, helper);\n",
    "prefixes": [
        "net",
        "11/14"
    ]
}