get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216153,
    "url": "http://patchwork.ozlabs.org/api/patches/2216153/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260325222615.637793-9-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-9-pablo@netfilter.org>",
    "list_archive_url": null,
    "date": "2026-03-25T22:26:09",
    "name": "[net,08/14] netfilter: nf_conntrack_expect: honor expectation helper field",
    "commit_ref": null,
    "pull_url": null,
    "state": "handled-elsewhere",
    "archived": true,
    "hash": "efd0d77c5fd462390220945a4becb86bfa0f659b",
    "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-9-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/2216153/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216153/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <netfilter-devel+bounces-11427-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=Ycm9i/sA;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-11427-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=\"Ycm9i/sA\"",
            "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 [172.234.253.10])\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 4fh1pR3QTYz1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 09:31:11 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id DCDBC30F0863\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 22:26:44 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 3C73635DA76;\n\tWed, 25 Mar 2026 22:26:38 +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 09C943822AE;\n\tWed, 25 Mar 2026 22:26:36 +0000 (UTC)",
            "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 810ED60253;\n\tWed, 25 Mar 2026 23:26:33 +0100 (CET)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774477597; cv=none;\n b=RnWHsMWanxlPiwWZ4xKqgnV4WYgTCkHpiNqctyaEFbir5ZyeuIDX/JUvvFEKKEgVRk13DCUiCHr4DAUl0i6Sw9Bsiajgdqe0rhJb6XZQqeY/o7YmpKh7ndQV70hVVd1o4hG/Sn3iqYW4MJ3d6M4ksWU468xLNxK2t4jWEPLm7OA=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774477597; c=relaxed/simple;\n\tbh=w9FIUx0v0Qp3GBaguyz6w92Mv2UIgTtyGFsY3Imt3Ac=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=Iir2o7vtkbzB06/6yPbNprdo17r42KdTBMbjjpFGzclFGXhMPOGfF9xwvMp2zk8PMx5q3fqk9fOZmdKxR8P1uDYK5S1Zw6WwtMCBBqEEwKBanxO5uMwj8YtWyVCIgNp7qpgIFRHzT2mTMZCOob/+OGpR+LJ1A4v8vdXaxUHKXgg=",
        "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=Ycm9i/sA; 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=1774477594;\n\tbh=+NbN5O/uWXAdsBJq9nQa4A8E5k87OUZjnzdXlSAYu4I=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Ycm9i/sAWZM3nWVaetghq0Tax/Scoj9cTfCH1Eg6kNqAZcOXdjCcSmxzhu/IpCKaT\n\t ezSUnPwKVmSySG8IkRi2sB19UG0KucZlikBTvwjvQq9E1rNVv38rr8TNN7M2IpR2xd\n\t p90AVUfJMgRRhqLycM4NIisOrMMSwmGz9CZHPI6hUFWwSZ2F3cdsGFWR5Al0qAvytT\n\t MpzSj+zfro210HM7vqWaMhtRz4mAz49F4YrfXiFVUhArDTioEkZTTnrUpfPG54TZlu\n\t FVD3N4bKusNukvs5hkdB9TnUkWaK/YIOSEMa62V1zhk7n3j6yLGNpoP13zwq5Do3jZ\n\t yR4amZITFSrfw==",
        "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 08/14] netfilter: nf_conntrack_expect: honor expectation\n helper field",
        "Date": "Wed, 25 Mar 2026 23:26:09 +0100",
        "Message-ID": "<20260325222615.637793-9-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": "The expectation helper field is mostly unused. As a result, the\nnetfilter codebase relies on accessing the helper through exp->master.\n\nAlways set on the expectation helper field so it can be used to reach\nthe helper.\n\nnf_ct_expect_init() is called from packet path where the skb owns\nthe ct object, therefore accessing exp->master for the newly created\nexpectation is safe. This saves a lot of updates in all callsites\nto pass the ct object as parameter to nf_ct_expect_init().\n\nThis is a preparation patches for follow up fixes.\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 |  2 +-\n net/netfilter/nf_conntrack_broadcast.c      |  2 +-\n net/netfilter/nf_conntrack_expect.c         | 14 +++++++++++++-\n net/netfilter/nf_conntrack_h323_main.c      | 12 ++++++------\n net/netfilter/nf_conntrack_helper.c         |  7 ++++++-\n net/netfilter/nf_conntrack_netlink.c        |  2 +-\n net/netfilter/nf_conntrack_sip.c            |  2 +-\n 7 files changed, 29 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h\nindex 165e7a03b8e9..1b01400b10bd 100644\n--- a/include/net/netfilter/nf_conntrack_expect.h\n+++ b/include/net/netfilter/nf_conntrack_expect.h\n@@ -40,7 +40,7 @@ struct nf_conntrack_expect {\n \t\t\t struct nf_conntrack_expect *this);\n \n \t/* Helper to assign to new connection */\n-\tstruct nf_conntrack_helper *helper;\n+\tstruct nf_conntrack_helper __rcu *helper;\n \n \t/* The conntrack of the master connection */\n \tstruct nf_conn *master;\ndiff --git a/net/netfilter/nf_conntrack_broadcast.c b/net/netfilter/nf_conntrack_broadcast.c\nindex a7552a46d6ac..1964c596c646 100644\n--- a/net/netfilter/nf_conntrack_broadcast.c\n+++ b/net/netfilter/nf_conntrack_broadcast.c\n@@ -70,7 +70,7 @@ int nf_conntrack_broadcast_help(struct sk_buff *skb,\n \texp->expectfn             = NULL;\n \texp->flags                = NF_CT_EXPECT_PERMANENT;\n \texp->class\t\t  = NF_CT_EXPECT_CLASS_DEFAULT;\n-\texp->helper               = NULL;\n+\trcu_assign_pointer(exp->helper, helper);\n \n \tnf_ct_expect_related(exp, 0);\n \tnf_ct_expect_put(exp);\ndiff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c\nindex cfc2daa3fc7f..841e316240da 100644\n--- a/net/netfilter/nf_conntrack_expect.c\n+++ b/net/netfilter/nf_conntrack_expect.c\n@@ -309,12 +309,19 @@ struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me)\n }\n EXPORT_SYMBOL_GPL(nf_ct_expect_alloc);\n \n+/* This function can only be used from packet path, where accessing\n+ * master's helper is safe, because the packet holds a reference on\n+ * the conntrack object. Never use it from control plane.\n+ */\n void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,\n \t\t       u_int8_t family,\n \t\t       const union nf_inet_addr *saddr,\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 nf_conntrack_helper *helper = NULL;\n+\tstruct nf_conn *ct = exp->master;\n+\tstruct nf_conn_help *help;\n \tint len;\n \n \tif (family == AF_INET)\n@@ -325,7 +332,12 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,\n \texp->flags = 0;\n \texp->class = class;\n \texp->expectfn = NULL;\n-\texp->helper = NULL;\n+\n+\thelp = nfct_help(ct);\n+\tif (help)\n+\t\thelper = rcu_dereference(help->helper);\n+\n+\trcu_assign_pointer(exp->helper, helper);\n \texp->tuple.src.l3num = family;\n \texp->tuple.dst.protonum = proto;\n \ndiff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c\nindex a2a0e22ccee1..3f5c50455b71 100644\n--- a/net/netfilter/nf_conntrack_h323_main.c\n+++ b/net/netfilter/nf_conntrack_h323_main.c\n@@ -643,7 +643,7 @@ static int expect_h245(struct sk_buff *skb, struct nf_conn *ct,\n \t\t\t  &ct->tuplehash[!dir].tuple.src.u3,\n \t\t\t  &ct->tuplehash[!dir].tuple.dst.u3,\n \t\t\t  IPPROTO_TCP, NULL, &port);\n-\texp->helper = &nf_conntrack_helper_h245;\n+\trcu_assign_pointer(exp->helper, &nf_conntrack_helper_h245);\n \n \tnathook = rcu_dereference(nfct_h323_nat_hook);\n \tif (memcmp(&ct->tuplehash[dir].tuple.src.u3,\n@@ -767,7 +767,7 @@ static int expect_callforwarding(struct sk_buff *skb,\n \tnf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, nf_ct_l3num(ct),\n \t\t\t  &ct->tuplehash[!dir].tuple.src.u3, &addr,\n \t\t\t  IPPROTO_TCP, NULL, &port);\n-\texp->helper = nf_conntrack_helper_q931;\n+\trcu_assign_pointer(exp->helper, nf_conntrack_helper_q931);\n \n \tnathook = rcu_dereference(nfct_h323_nat_hook);\n \tif (memcmp(&ct->tuplehash[dir].tuple.src.u3,\n@@ -1234,7 +1234,7 @@ static int expect_q931(struct sk_buff *skb, struct nf_conn *ct,\n \t\t\t\t&ct->tuplehash[!dir].tuple.src.u3 : NULL,\n \t\t\t  &ct->tuplehash[!dir].tuple.dst.u3,\n \t\t\t  IPPROTO_TCP, NULL, &port);\n-\texp->helper = nf_conntrack_helper_q931;\n+\trcu_assign_pointer(exp->helper, nf_conntrack_helper_q931);\n \texp->flags = NF_CT_EXPECT_PERMANENT;\t/* Accept multiple calls */\n \n \tnathook = rcu_dereference(nfct_h323_nat_hook);\n@@ -1306,7 +1306,7 @@ static int process_gcf(struct sk_buff *skb, struct nf_conn *ct,\n \tnf_ct_expect_init(exp, NF_CT_EXPECT_CLASS_DEFAULT, nf_ct_l3num(ct),\n \t\t\t  &ct->tuplehash[!dir].tuple.src.u3, &addr,\n \t\t\t  IPPROTO_UDP, NULL, &port);\n-\texp->helper = nf_conntrack_helper_ras;\n+\trcu_assign_pointer(exp->helper, nf_conntrack_helper_ras);\n \n \tif (nf_ct_expect_related(exp, 0) == 0) {\n \t\tpr_debug(\"nf_ct_ras: expect RAS \");\n@@ -1523,7 +1523,7 @@ static int process_acf(struct sk_buff *skb, struct nf_conn *ct,\n \t\t\t  &ct->tuplehash[!dir].tuple.src.u3, &addr,\n \t\t\t  IPPROTO_TCP, NULL, &port);\n \texp->flags = NF_CT_EXPECT_PERMANENT;\n-\texp->helper = nf_conntrack_helper_q931;\n+\trcu_assign_pointer(exp->helper, nf_conntrack_helper_q931);\n \n \tif (nf_ct_expect_related(exp, 0) == 0) {\n \t\tpr_debug(\"nf_ct_ras: expect Q.931 \");\n@@ -1577,7 +1577,7 @@ static int process_lcf(struct sk_buff *skb, struct nf_conn *ct,\n \t\t\t  &ct->tuplehash[!dir].tuple.src.u3, &addr,\n \t\t\t  IPPROTO_TCP, NULL, &port);\n \texp->flags = NF_CT_EXPECT_PERMANENT;\n-\texp->helper = nf_conntrack_helper_q931;\n+\trcu_assign_pointer(exp->helper, nf_conntrack_helper_q931);\n \n \tif (nf_ct_expect_related(exp, 0) == 0) {\n \t\tpr_debug(\"nf_ct_ras: expect Q.931 \");\ndiff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c\nindex ceb48c3ca0a4..294a6ffcbccd 100644\n--- a/net/netfilter/nf_conntrack_helper.c\n+++ b/net/netfilter/nf_conntrack_helper.c\n@@ -399,7 +399,7 @@ static bool expect_iter_me(struct nf_conntrack_expect *exp, void *data)\n \tconst struct nf_conntrack_helper *me = data;\n \tconst struct nf_conntrack_helper *this;\n \n-\tif (exp->helper == me)\n+\tif (rcu_access_pointer(exp->helper) == me)\n \t\treturn true;\n \n \tthis = rcu_dereference_protected(help->helper,\n@@ -421,6 +421,11 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me)\n \n \tnf_ct_expect_iterate_destroy(expect_iter_me, NULL);\n \tnf_ct_iterate_destroy(unhelp, me);\n+\n+\t/* nf_ct_iterate_destroy() does an unconditional synchronize_rcu() as\n+\t * last step, this ensures rcu readers of exp->helper are done.\n+\t * No need for another synchronize_rcu() here.\n+\t */\n }\n EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);\n \ndiff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c\nindex c156574e1273..a42d14290786 100644\n--- a/net/netfilter/nf_conntrack_netlink.c\n+++ b/net/netfilter/nf_conntrack_netlink.c\n@@ -3573,7 +3573,7 @@ ctnetlink_alloc_expect(const struct nlattr * const cda[], struct nf_conn *ct,\n \n \texp->class = class;\n \texp->master = ct;\n-\texp->helper = helper;\n+\trcu_assign_pointer(exp->helper, helper);\n \texp->tuple = *tuple;\n \texp->mask.src.u3 = mask->src.u3;\n \texp->mask.src.u.all = mask->src.u.all;\ndiff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c\nindex 4ab5ef71d96d..106b2f419e19 100644\n--- a/net/netfilter/nf_conntrack_sip.c\n+++ b/net/netfilter/nf_conntrack_sip.c\n@@ -1297,7 +1297,7 @@ static int process_register_request(struct sk_buff *skb, unsigned int protoff,\n \tnf_ct_expect_init(exp, SIP_EXPECT_SIGNALLING, nf_ct_l3num(ct),\n \t\t\t  saddr, &daddr, proto, NULL, &port);\n \texp->timeout.expires = sip_timeout * HZ;\n-\texp->helper = helper;\n+\trcu_assign_pointer(exp->helper, helper);\n \texp->flags = NF_CT_EXPECT_PERMANENT | NF_CT_EXPECT_INACTIVE;\n \n \thooks = rcu_dereference(nf_nat_sip_hooks);\n",
    "prefixes": [
        "net",
        "08/14"
    ]
}