get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2215855,
    "url": "http://patchwork.ozlabs.org/api/patches/2215855/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-12-fw@strlen.de/",
    "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": "<20260325131108.23045-12-fw@strlen.de>",
    "list_archive_url": null,
    "date": "2026-03-25T13:11:05",
    "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": "7bd146add4dd92d3b87937d5771ecf0d4e05b985",
    "submitter": {
        "id": 1025,
        "url": "http://patchwork.ozlabs.org/api/people/1025/?format=api",
        "name": "Florian Westphal",
        "email": "fw@strlen.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325131108.23045-12-fw@strlen.de/mbox/",
    "series": [
        {
            "id": 497441,
            "url": "http://patchwork.ozlabs.org/api/series/497441/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=497441",
            "date": "2026-03-25T13:10:55",
            "name": "[net,01/14] netfilter: nft_set_pipapo_avx2: don't return non-matching entry on expiry",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497441/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2215855/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2215855/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-11405-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 spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11405-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=91.216.245.30",
            "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\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 4fgnps0jFLz1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 00:30:45 +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 AAFA3301983B\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 13:13:56 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 42A123DCDAB;\n\tWed, 25 Mar 2026 13:12:24 +0000 (UTC)",
            "from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc\n [91.216.245.30])\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 A51FB3D9022;\n\tWed, 25 Mar 2026 13:12:22 +0000 (UTC)",
            "by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid 514F860AE1; Wed, 25 Mar 2026 14:12:21 +0100 (CET)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774444344; cv=none;\n b=Cy62wdjyhaHzjrwx6F/EVWus2m+H6gLXceCXKhrlICsZYN6ig7wFc8YCSNnR6HDNecRlhATv/uMxk/+uh4t27GmDiWeTpFw4fW1wIbNEQcf/vmmqFg1+BJZOacnwpwfRocF1baPupVrePjlo7OdR4tmPDtMqkcUoYoECpNPkGuw=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774444344; c=relaxed/simple;\n\tbh=/E6hGD2SWtfR8W6UsJdY6xZ4Q4GbinANu0aUHkmUkEA=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=M42j28R3Xd5Ie1dAkMPhe+4v6nev8XKMvsdIqoxglswcE4YFFkB6VDeXojIOfXe0fGG/UDyiIv//PzPdhDkx6MHBZH7+VuEpoYdDsiAZtUE6OhmuNTyVmU23dxshPA28QAn/jW+AdanCncGz+SMmwaYAYtQi+dN1YGXp1SJCW+U=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=strlen.de;\n spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc;\n arc=none smtp.client-ip=91.216.245.30",
        "From": "Florian Westphal <fw@strlen.de>",
        "To": "<netdev@vger.kernel.org>",
        "Cc": "Paolo Abeni <pabeni@redhat.com>,\n\t\"David S. Miller\" <davem@davemloft.net>,\n\tEric Dumazet <edumazet@google.com>,\n\tJakub Kicinski <kuba@kernel.org>,\n\t<netfilter-devel@vger.kernel.org>,\n\tpablo@netfilter.org",
        "Subject": "[PATCH net 11/14] netfilter: nf_conntrack_expect: store netns and\n zone in expectation",
        "Date": "Wed, 25 Mar 2026 14:11:05 +0100",
        "Message-ID": "<20260325131108.23045-12-fw@strlen.de>",
        "X-Mailer": "git-send-email 2.52.0",
        "In-Reply-To": "<20260325131108.23045-1-fw@strlen.de>",
        "References": "<20260325131108.23045-1-fw@strlen.de>",
        "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": "From: Pablo Neira Ayuso <pablo@netfilter.org>\n\n__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: Pablo Neira Ayuso <pablo@netfilter.org>\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n include/net/netfilter/nf_conntrack_expect.h | 18 +++++++++++++++++-\n net/netfilter/nf_conntrack_expect.c         |  8 ++++++--\n net/netfilter/nf_conntrack_netlink.c        |  3 +++\n 3 files changed, 26 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 2505d1f4b68c..8896fb20b58e 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@@ -324,6 +324,8 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,\n \t\t       const union nf_inet_addr *daddr,\n \t\t       u_int8_t proto, const __be16 *src, const __be16 *dst)\n {\n+\tstruct net *net = read_pnet(&exp->master->ct_net);\n+\n \tint len;\n \n \tif (family == AF_INET)\n@@ -335,6 +337,8 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,\n \texp->class = class;\n \texp->expectfn = NULL;\n \trcu_assign_pointer(exp->helper, nfct_help(exp->master)->helper);\n+\twrite_pnet(&exp->net, net);\n+\texp->zone = exp->master->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"
    ]
}