mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH nf] net/sched: act_ct: set net pointer before publishing flowtable
@ 2026-09-09  7:56 Qingfang Deng
  2026-09-10  6:09 ` Xuanqiang Luo
  0 siblings, 1 reply; 4+ messages in thread
From: Qingfang Deng @ 2026-09-09  7:56 UTC (permalink / raw)
  To: netfilter-devel, Jamal Hadi Salim, Jiri Pirko, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
	Oz Shlomo, Vlad Buslov, Pablo Neira Ayuso, netdev, linux-kernel
  Cc: Qingfang Deng

nf_flow_table_init() adds the flowtable to the global flowtables list.
However, tcf_ct_flow_table_get() sets the table's network namespace only
after that call, leaving a window where the published table has a NULL
namespace pointer.

Set the namespace before calling nf_flow_table_init() so that flowtable
list walkers can rely on it being initialized.

Fixes: fc54d9065f90 ("net/sched: act_ct: set 'net' pointer when creating new nf_flow_table")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
 net/sched/act_ct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index 9080cb386c16..6bd19db68d97 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -349,10 +349,10 @@ static int tcf_ct_flow_table_get(struct net *net, struct tcf_ct_params *params)
 	ct_ft->nf_ft.type = &flowtable_ct;
 	ct_ft->nf_ft.flags |= NF_FLOWTABLE_HW_OFFLOAD |
 			      NF_FLOWTABLE_COUNTER;
+	write_pnet(&ct_ft->nf_ft.net, net);
 	err = nf_flow_table_init(&ct_ft->nf_ft);
 	if (err)
 		goto err_init;
-	write_pnet(&ct_ft->nf_ft.net, net);
 
 	__module_get(THIS_MODULE);
 out_unlock:
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-10  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-09  7:56 [PATCH nf] net/sched: act_ct: set net pointer before publishing flowtable Qingfang Deng
2026-09-10  6:09 ` Xuanqiang Luo
2026-09-10  9:03   ` Qingfang Deng
2026-09-10  9:43     ` Xuanqiang Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®