Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2233372/?format=api
{ "id": 2233372, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233372/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260506100728.2664-5-fw@strlen.de/", "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": "<20260506100728.2664-5-fw@strlen.de>", "date": "2026-05-06T10:07:16", "name": "[v3,nf,4/8] netfilter: x_tables: unregister the templates first", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "3571090512b4a4d9f669cb54f5a0896be2234baa", "submitter": { "id": 1025, "url": "http://patchwork.ozlabs.org/api/1.1/people/1025/?format=api", "name": "Florian Westphal", "email": "fw@strlen.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260506100728.2664-5-fw@strlen.de/mbox/", "series": [ { "id": 502948, "url": "http://patchwork.ozlabs.org/api/1.1/series/502948/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=502948", "date": "2026-05-06T10:07:14", "name": "netfilter: xtables: fix module load and teardown races", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/502948/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2233372/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2233372/checks/", "tags": {}, "headers": { "Return-Path": "\n <netfilter-devel+bounces-12455-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=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12455-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\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 4g9WTK2yTNz1yJq\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 20:14:45 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id EBCB23078252\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 6 May 2026 10:07:58 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 8E6763FB049;\n\tWed, 6 May 2026 10:07:58 +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 422163FADFB\n\tfor <netfilter-devel@vger.kernel.org>; Wed, 6 May 2026 10:07:54 +0000 (UTC)", "by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)\n\tid 6D714605F3; Wed, 06 May 2026 12:07:51 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1778062076; cv=none;\n b=lPY1ekaTUe8DnGO5VMJeOLzkZlZFXzwrxwkWzkuKZY3kxngqoZY+vkcXlyEwrim9YKxWlCZ+NdD4xPy7EMW7hjdjejq3prJrk2i7cb/d1HjKxnTuleeBDbaLRpR7E+BJ8QfyMecxfHPlx2ELeiulENHcxwSrtv+EMJftwzWwvAg=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1778062076; c=relaxed/simple;\n\tbh=XBwSrgbRaweln8CmlRWyP1hsWeqY1HaKbv7/E7JcT1w=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=cdZy7c/IvJqTVZurMwvdmKzlU+JjNacJHrnsatGmBPbTYirwPSKlizfKU71q1duDtCwUwAFW+sP3P86+BO8BbmTYb6QHWht6EDhqh55x1pGYqDBHxR+Sjsi59TuqkOhiHNzOFnacV2+MLf5UYFI49FSGXGR6fqRDaWLP398y7s8=", "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": "<netfilter-devel@vger.kernel.org>", "Cc": "tristan@talencesecurity.com,\n\tFlorian Westphal <fw@strlen.de>", "Subject": "[PATCH v3 nf 4/8] netfilter: x_tables: unregister the templates first", "Date": "Wed, 6 May 2026 12:07:16 +0200", "Message-ID": "<20260506100728.2664-5-fw@strlen.de>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260506100728.2664-1-fw@strlen.de>", "References": "<20260506100728.2664-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": "When the module is going away we need to zap the template\nfirst. Else there is a small race window where userspace\ncould instantiate a new table after the pernet exit function\nhas removed the current table.\n\nFixes: fdacd57c79b7 (\"netfilter: x_tables: never register tables by default\")\nReported-by: Tristan Madani <tristan@talencesecurity.com>\nReviewed-by: Tristan Madani <tristan@talencesecurity.com>\nCloses: https://lore.kernel.org/netfilter-devel/20260429175613.1459342-1-tristmd@gmail.com/\nSigned-off-by: Florian Westphal <fw@strlen.de>\n---\n v3: no changes.\n net/ipv4/netfilter/arptable_filter.c | 2 +-\n net/ipv4/netfilter/iptable_filter.c | 2 +-\n net/ipv4/netfilter/iptable_mangle.c | 2 +-\n net/ipv4/netfilter/iptable_raw.c | 2 +-\n net/ipv4/netfilter/iptable_security.c | 2 +-\n net/ipv6/netfilter/ip6table_filter.c | 2 +-\n net/ipv6/netfilter/ip6table_mangle.c | 2 +-\n net/ipv6/netfilter/ip6table_raw.c | 2 +-\n net/ipv6/netfilter/ip6table_security.c | 2 +-\n 9 files changed, 9 insertions(+), 9 deletions(-)", "diff": "diff --git a/net/ipv4/netfilter/arptable_filter.c b/net/ipv4/netfilter/arptable_filter.c\nindex 393d9a8c7739..382345567a60 100644\n--- a/net/ipv4/netfilter/arptable_filter.c\n+++ b/net/ipv4/netfilter/arptable_filter.c\n@@ -82,8 +82,8 @@ static int __init arptable_filter_init(void)\n \n static void __exit arptable_filter_fini(void)\n {\n-\tunregister_pernet_subsys(&arptable_filter_net_ops);\n \txt_unregister_template(&packet_filter);\n+\tunregister_pernet_subsys(&arptable_filter_net_ops);\n \tkfree(arpfilter_ops);\n }\n \ndiff --git a/net/ipv4/netfilter/iptable_filter.c b/net/ipv4/netfilter/iptable_filter.c\nindex b2fbd9651d61..0dea754a9120 100644\n--- a/net/ipv4/netfilter/iptable_filter.c\n+++ b/net/ipv4/netfilter/iptable_filter.c\n@@ -101,8 +101,8 @@ static int __init iptable_filter_init(void)\n \n static void __exit iptable_filter_fini(void)\n {\n-\tunregister_pernet_subsys(&iptable_filter_net_ops);\n \txt_unregister_template(&packet_filter);\n+\tunregister_pernet_subsys(&iptable_filter_net_ops);\n \tkfree(filter_ops);\n }\n \ndiff --git a/net/ipv4/netfilter/iptable_mangle.c b/net/ipv4/netfilter/iptable_mangle.c\nindex a99e61996197..4d3b12492308 100644\n--- a/net/ipv4/netfilter/iptable_mangle.c\n+++ b/net/ipv4/netfilter/iptable_mangle.c\n@@ -135,8 +135,8 @@ static int __init iptable_mangle_init(void)\n \n static void __exit iptable_mangle_fini(void)\n {\n-\tunregister_pernet_subsys(&iptable_mangle_net_ops);\n \txt_unregister_template(&packet_mangler);\n+\tunregister_pernet_subsys(&iptable_mangle_net_ops);\n \tkfree(mangle_ops);\n }\n \ndiff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c\nindex 42511721e538..6f7afec7954b 100644\n--- a/net/ipv4/netfilter/iptable_raw.c\n+++ b/net/ipv4/netfilter/iptable_raw.c\n@@ -100,9 +100,9 @@ static int __init iptable_raw_init(void)\n \n static void __exit iptable_raw_fini(void)\n {\n+\txt_unregister_template(&packet_raw);\n \tunregister_pernet_subsys(&iptable_raw_net_ops);\n \tkfree(rawtable_ops);\n-\txt_unregister_template(&packet_raw);\n }\n \n module_init(iptable_raw_init);\ndiff --git a/net/ipv4/netfilter/iptable_security.c b/net/ipv4/netfilter/iptable_security.c\nindex 4646bf6d7d2b..81175c20ccbe 100644\n--- a/net/ipv4/netfilter/iptable_security.c\n+++ b/net/ipv4/netfilter/iptable_security.c\n@@ -89,9 +89,9 @@ static int __init iptable_security_init(void)\n \n static void __exit iptable_security_fini(void)\n {\n+\txt_unregister_template(&security_table);\n \tunregister_pernet_subsys(&iptable_security_net_ops);\n \tkfree(sectbl_ops);\n-\txt_unregister_template(&security_table);\n }\n \n module_init(iptable_security_init);\ndiff --git a/net/ipv6/netfilter/ip6table_filter.c b/net/ipv6/netfilter/ip6table_filter.c\nindex f05a9e4b2c67..cf561919bde8 100644\n--- a/net/ipv6/netfilter/ip6table_filter.c\n+++ b/net/ipv6/netfilter/ip6table_filter.c\n@@ -100,8 +100,8 @@ static int __init ip6table_filter_init(void)\n \n static void __exit ip6table_filter_fini(void)\n {\n-\tunregister_pernet_subsys(&ip6table_filter_net_ops);\n \txt_unregister_template(&packet_filter);\n+\tunregister_pernet_subsys(&ip6table_filter_net_ops);\n \tkfree(filter_ops);\n }\n \ndiff --git a/net/ipv6/netfilter/ip6table_mangle.c b/net/ipv6/netfilter/ip6table_mangle.c\nindex afa4a5703e43..1a758f2bc537 100644\n--- a/net/ipv6/netfilter/ip6table_mangle.c\n+++ b/net/ipv6/netfilter/ip6table_mangle.c\n@@ -128,8 +128,8 @@ static int __init ip6table_mangle_init(void)\n \n static void __exit ip6table_mangle_fini(void)\n {\n-\tunregister_pernet_subsys(&ip6table_mangle_net_ops);\n \txt_unregister_template(&packet_mangler);\n+\tunregister_pernet_subsys(&ip6table_mangle_net_ops);\n \tkfree(mangle_ops);\n }\n \ndiff --git a/net/ipv6/netfilter/ip6table_raw.c b/net/ipv6/netfilter/ip6table_raw.c\nindex 32d2da81c52a..923455921c1d 100644\n--- a/net/ipv6/netfilter/ip6table_raw.c\n+++ b/net/ipv6/netfilter/ip6table_raw.c\n@@ -98,8 +98,8 @@ static int __init ip6table_raw_init(void)\n \n static void __exit ip6table_raw_fini(void)\n {\n-\tunregister_pernet_subsys(&ip6table_raw_net_ops);\n \txt_unregister_template(&packet_raw);\n+\tunregister_pernet_subsys(&ip6table_raw_net_ops);\n \tkfree(rawtable_ops);\n }\n \ndiff --git a/net/ipv6/netfilter/ip6table_security.c b/net/ipv6/netfilter/ip6table_security.c\nindex 3dfd8d6ea4b9..c44834d93fc7 100644\n--- a/net/ipv6/netfilter/ip6table_security.c\n+++ b/net/ipv6/netfilter/ip6table_security.c\n@@ -88,8 +88,8 @@ static int __init ip6table_security_init(void)\n \n static void __exit ip6table_security_fini(void)\n {\n-\tunregister_pernet_subsys(&ip6table_security_net_ops);\n \txt_unregister_template(&security_table);\n+\tunregister_pernet_subsys(&ip6table_security_net_ops);\n \tkfree(sectbl_ops);\n }\n \n", "prefixes": [ "v3", "nf", "4/8" ] }