Thread (7 messages) 7 messages, 4 authors, 2025-07-23
STALE335d

[PATCH net, 1/2] net: core: Fix missing init of llist_node in setup_net()

From: Haiyang Zhang <hidden>
Date: 2025-07-22 23:51:14
Also in: linux-hyperv, lkml, stable
Subsystem: networking [general], the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

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();
-- 
2.34.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help