From: Haiyang Zhang haiyangz@microsoft.com
Add init_llist_node for lock-less list nodes in struct net in setup_net(), so we can test if a node is on a list or not.
Cc: stable@vger.kernel.org Fixes: d6b3358a2813 ("llist: add interface to check if a node is on a list.") Signed-off-by: Haiyang Zhang haiyangz@microsoft.com --- net/core/net_namespace.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index ae54f26709ca..2a821849558f 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -434,6 +434,9 @@ static __net_init int setup_net(struct net *net) LIST_HEAD(net_exit_list); int error = 0;
+ init_llist_node(&net->defer_free_list); + init_llist_node(&net->cleanup_list); + preempt_disable(); net->net_cookie = gen_cookie_next(&net_cookie); preempt_enable();
On Tue, Jul 22, 2025 at 4:51 PM Haiyang Zhang haiyangz@linux.microsoft.com wrote:
From: Haiyang Zhang haiyangz@microsoft.com
Add init_llist_node for lock-less list nodes in struct net in setup_net(), so we can test if a node is on a list or not.
Cc: stable@vger.kernel.org Fixes: d6b3358a2813 ("llist: add interface to check if a node is on a list.")
No Fixes tag is needed because we didn't have a need to test if net is queued for destruction.
Signed-off-by: Haiyang Zhang haiyangz@microsoft.com
net/core/net_namespace.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index ae54f26709ca..2a821849558f 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -434,6 +434,9 @@ static __net_init int setup_net(struct net *net) LIST_HEAD(net_exit_list); int error = 0;
init_llist_node(&net->defer_free_list);
init_llist_node(&net->cleanup_list);
preempt_disable(); net->net_cookie = gen_cookie_next(&net_cookie); preempt_enable();
-- 2.34.1
-----Original Message----- From: Kuniyuki Iwashima kuniyu@google.com Sent: Tuesday, July 22, 2025 8:02 PM To: Haiyang Zhang haiyangz@linux.microsoft.com Cc: linux-hyperv@vger.kernel.org; netdev@vger.kernel.org; Haiyang Zhang haiyangz@microsoft.com; KY Srinivasan kys@microsoft.com; wei.liu@kernel.org; Dexuan Cui decui@microsoft.com; andrew+netdev@lunn.ch; sd@queasysnail.net; viro@zeniv.linux.org.uk; chuck.lever@oracle.com; neil@brown.name; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; horms@kernel.org; davem@davemloft.net; linux-kernel@vger.kernel.org; stable@vger.kernel.org Subject: [EXTERNAL] Re: [PATCH net, 1/2] net: core: Fix missing init of llist_node in setup_net()
[You don't often get email from kuniyu@google.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
On Tue, Jul 22, 2025 at 4:51 PM Haiyang Zhang haiyangz@linux.microsoft.com wrote:
From: Haiyang Zhang haiyangz@microsoft.com
Add init_llist_node for lock-less list nodes in struct net in setup_net(), so we can test if a node is on a list or not.
Cc: stable@vger.kernel.org Fixes: d6b3358a2813 ("llist: add interface to check if a node is on a
list.")
No Fixes tag is needed because we didn't have a need to test if net is queued for destruction.
I know the original patch wasn't buggy. This tag is just for the stable backport version hint.
In another thread, Eric Dumazet recommended Fixes tag for patches for "stable": https://patchwork.kernel.org/project/netdevbpf/patch/1752870014-28909-1-git-...
Thanks, - Haiyang
linux-stable-mirror@lists.linaro.org