Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2225372/?format=api
{ "id": 2225372, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2225372/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260420220215.111510-6-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": "<20260420220215.111510-6-pablo@netfilter.org>", "date": "2026-04-20T22:02:12", "name": "[net,5/8] netfilter: nat: use kfree_rcu to release ops", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "e92c27ce2c9c19710ea5a860957ec14298d558cd", "submitter": { "id": 1315, "url": "http://patchwork.ozlabs.org/api/1.1/people/1315/?format=api", "name": "Pablo Neira Ayuso", "email": "pablo@netfilter.org" }, "delegate": { "id": 11902, "url": "http://patchwork.ozlabs.org/api/1.1/users/11902/?format=api", "username": "strlen", "first_name": "Florian", "last_name": "Westphal", "email": "fw@strlen.de" }, "mbox": "http://patchwork.ozlabs.org/project/netfilter-devel/patch/20260420220215.111510-6-pablo@netfilter.org/mbox/", "series": [ { "id": 500691, "url": "http://patchwork.ozlabs.org/api/1.1/series/500691/?format=api", "web_url": "http://patchwork.ozlabs.org/project/netfilter-devel/list/?series=500691", "date": "2026-04-20T22:02:07", "name": "[net,1/8] netfilter: nft_osf: restrict it to ipv4", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/500691/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2225372/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2225372/checks/", "tags": {}, "headers": { "Return-Path": "\n <netfilter-devel+bounces-12099-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=ixQVaXgT;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.232.135.74; helo=sto.lore.kernel.org;\n envelope-from=netfilter-devel+bounces-12099-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=\"ixQVaXgT\"", "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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])\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 4fzzyJ5WjHz1yD8\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 08:03:20 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 41A0B301063A\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 22:02:44 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 42EF73D0934;\n\tMon, 20 Apr 2026 22:02:29 +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 91DA73D0913;\n\tMon, 20 Apr 2026 22:02:27 +0000 (UTC)", "from localhost.localdomain (mail-agni [217.70.190.124])\n\tby mail.netfilter.org (Postfix) with ESMTPSA id 944146017E;\n\tTue, 21 Apr 2026 00:02:25 +0200 (CEST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776722548; cv=none;\n b=uAzEBM8SkICkHILLcnQVNLdYUyF0m6X5YZPYsZ1HA8nf1y03I+wwpZhi9vG6QYu1es17SWDwbfOmNMJIjG85QY6EMUgcmc9DSw8QZ4TaqXb5V8yf3MJu9tU4HtLgJQJtBgQGhSJyfmkBTrsOU9lqzJKVe42Ahuo2CNSIE1NOZvw=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776722548; c=relaxed/simple;\n\tbh=2IDGdpGXwtsRHlqWkhBm4VgoOH1ALREv7M1k+OorbuU=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=M+ZUcbel3nl/JFBCGq1VUHInzaAsSQIy3YTtfDUpa13M01HozRVEAXgr2J9OebbZY6pm7F+hFGUpUnLpzMFpKSydV1eCuVv9xnSG/5k14nuTq1YqHiMdBezXFQlOPHfQDkIf1beB+75gdTS7oq7JJVtBGIjJvF+3LgOrqDS8gKQ=", "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=ixQVaXgT; 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=1776722546;\n\tbh=6ZYWBwfUPA/n7GvhkC1s1YmHPSpBmXBnMfK/WS3flBQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ixQVaXgTCKCnB+jXakch0GphsovsxCeCWE72jvx8rwa9FQKjLDxfax3DqglHmorit\n\t npC0fHl6byl3+3eswQbVQwXei5nUvkWWdCc7VJVK14meoNe+OFlioUXKpr5MqtM6jj\n\t IE5HVzyM9SUXVLI01p1lZxK8XgUNbQqIhQfuhGYQKUWGrmYpA+9/fiXY6qHvkhzuZf\n\t sCXkjCLrklOficnIJLpWlGwsuLLFqTfYlW+2Lcdr6NH++NToHYWeHXHtT6OhleYss4\n\t RsWva3UzId3pX0OdgNmImj6fKt0h3ZG+8zhYxrVmEmQRatE9wMjLrv9gyvF/VqfEiH\n\t o/nnm4e+4fRwg==", "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 5/8] netfilter: nat: use kfree_rcu to release ops", "Date": "Tue, 21 Apr 2026 00:02:12 +0200", "Message-ID": "<20260420220215.111510-6-pablo@netfilter.org>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260420220215.111510-1-pablo@netfilter.org>", "References": "<20260420220215.111510-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": "Florian Westphal says:\n\n\"Historically this is not an issue, even for normal base hooks: the data\npath doesn't use the original nf_hook_ops that are used to register the\ncallbacks.\n\nHowever, in v5.14 I added the ability to dump the active netfilter\nhooks from userspace.\n\nThis code will peek back into the nf_hook_ops that are available\nat the tail of the pointer-array blob used by the datapath.\n\nThe nat hooks are special, because they are called indirectly from\nthe central nat dispatcher hook. They are currently invisible to\nthe nfnl hook dump subsystem though.\n\nBut once that changes the nat ops structures have to be deferred too.\"\n\nUpdate nf_nat_register_fn() to deal with partial exposition of the hooks\nfrom error path which can be also an issue for nfnetlink_hook.\n\nFixes: e2cf17d3774c (\"netfilter: add new hook nfnl subsystem\")\nSigned-off-by: Pablo Neira Ayuso <pablo@netfilter.org>\n---\n net/ipv4/netfilter/iptable_nat.c | 4 ++--\n net/ipv6/netfilter/ip6table_nat.c | 4 ++--\n net/netfilter/nf_nat_core.c | 10 ++++++----\n 3 files changed, 10 insertions(+), 8 deletions(-)", "diff": "diff --git a/net/ipv4/netfilter/iptable_nat.c b/net/ipv4/netfilter/iptable_nat.c\nindex a5db7c67d61b..625a1ca13b1b 100644\n--- a/net/ipv4/netfilter/iptable_nat.c\n+++ b/net/ipv4/netfilter/iptable_nat.c\n@@ -79,7 +79,7 @@ static int ipt_nat_register_lookups(struct net *net)\n \t\t\twhile (i)\n \t\t\t\tnf_nat_ipv4_unregister_fn(net, &ops[--i]);\n \n-\t\t\tkfree(ops);\n+\t\t\tkfree_rcu(ops, rcu);\n \t\t\treturn ret;\n \t\t}\n \t}\n@@ -100,7 +100,7 @@ static void ipt_nat_unregister_lookups(struct net *net)\n \tfor (i = 0; i < ARRAY_SIZE(nf_nat_ipv4_ops); i++)\n \t\tnf_nat_ipv4_unregister_fn(net, &ops[i]);\n \n-\tkfree(ops);\n+\tkfree_rcu(ops, rcu);\n }\n \n static int iptable_nat_table_init(struct net *net)\ndiff --git a/net/ipv6/netfilter/ip6table_nat.c b/net/ipv6/netfilter/ip6table_nat.c\nindex e119d4f090cc..5be723232df8 100644\n--- a/net/ipv6/netfilter/ip6table_nat.c\n+++ b/net/ipv6/netfilter/ip6table_nat.c\n@@ -81,7 +81,7 @@ static int ip6t_nat_register_lookups(struct net *net)\n \t\t\twhile (i)\n \t\t\t\tnf_nat_ipv6_unregister_fn(net, &ops[--i]);\n \n-\t\t\tkfree(ops);\n+\t\t\tkfree_rcu(ops, rcu);\n \t\t\treturn ret;\n \t\t}\n \t}\n@@ -102,7 +102,7 @@ static void ip6t_nat_unregister_lookups(struct net *net)\n \tfor (i = 0; i < ARRAY_SIZE(nf_nat_ipv6_ops); i++)\n \t\tnf_nat_ipv6_unregister_fn(net, &ops[i]);\n \n-\tkfree(ops);\n+\tkfree_rcu(ops, rcu);\n }\n \n static int ip6table_nat_table_init(struct net *net)\ndiff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c\nindex 83b2b5e9759a..74ec224ce0d6 100644\n--- a/net/netfilter/nf_nat_core.c\n+++ b/net/netfilter/nf_nat_core.c\n@@ -1222,9 +1222,11 @@ int nf_nat_register_fn(struct net *net, u8 pf, const struct nf_hook_ops *ops,\n \t\tret = nf_register_net_hooks(net, nat_ops, ops_count);\n \t\tif (ret < 0) {\n \t\t\tmutex_unlock(&nf_nat_proto_mutex);\n-\t\t\tfor (i = 0; i < ops_count; i++)\n-\t\t\t\tkfree(nat_ops[i].priv);\n-\t\t\tkfree(nat_ops);\n+\t\t\tfor (i = 0; i < ops_count; i++) {\n+\t\t\t\tpriv = nat_ops[i].priv;\n+\t\t\t\tkfree_rcu(priv, rcu_head);\n+\t\t\t}\n+\t\t\tkfree_rcu(nat_ops, rcu);\n \t\t\treturn ret;\n \t\t}\n \n@@ -1288,7 +1290,7 @@ void nf_nat_unregister_fn(struct net *net, u8 pf, const struct nf_hook_ops *ops,\n \t\t}\n \n \t\tnat_proto_net->nat_hook_ops = NULL;\n-\t\tkfree(nat_ops);\n+\t\tkfree_rcu(nat_ops, rcu);\n \t}\n unlock:\n \tmutex_unlock(&nf_nat_proto_mutex);\n", "prefixes": [ "net", "5/8" ] }