From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.migadu.com (out-33.mta1.migadu.com [95.215.58.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F657455638 for ; Wed, 9 Sep 2026 07:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788940579; cv=none; b=W5+P1dPGR1CxoGtTMPeok7mcZH2MgYikqlakOnX6ErIVxGUYIp1qdAc6Wi9StyjxvV8C6+Uxyqa/q64U2oXKOWX/Om5MvHkchKPulVecxt2RWa8lVbTHJOUU6vXLz++sC07hOldNKSuj/ao1s6AUuvPL1DgIXuDY8xDQkDyM69U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788940579; c=relaxed/simple; bh=NNu2AEdz7//rwAJPmsE49oyejxssnUM+nGFAvmkANE0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MfG72Pht1xPGJ03nJXYMUKiVOJmy/4/Uo5m85LRvNfPPH/UTX2++BUw/CLNkb7wXRHSWRWXhpcPkTOpqp2V0Y3BbwvM4cO4sgu/fX85h3Vcu0ctZQTfylVtJHgfEk9qI0rVJmqYqefVVgaID32/QpyQVwft5EfmHXeIaRhksT8A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=hpH474kx; arc=none smtp.client-ip=95.215.58.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="hpH474kx" X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=NNu2AEdz7//rwAJPmsE49oyejxssnUM+nGFAvmkANE0=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1788940575; v=1; x=1789545375; b=hpH474kx/DPfAC+QG78HnSjXVeZNzizOAs326X6xbHWV9vOSfTTBouBHh2aub+TJ+kVvPxHx RxOrXR6D3b5Hf8eKjq5XluVFkrHaaSauN5GF7Mht26PhCc1SshwlE9D0sBJHpHkMbvcoqjq/owJ 6Wao7A4bwKYOaVcfObijE0fI= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 590c92423473aef6; Wed, 09 Sep 2026 07:56:15 +0000 X-Mizu-Trace-ID: 590c92423473aef6 X-Migadu-Flow: FLOW_OUT From: Qingfang Deng To: netfilter-devel@vger.kernel.org, Jamal Hadi Salim , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Oz Shlomo , Vlad Buslov , Pablo Neira Ayuso , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Qingfang Deng Subject: [PATCH nf] net/sched: act_ct: set net pointer before publishing flowtable Date: Wed, 9 Sep 2026 15:56:05 +0800 Message-ID: <20260909075606.1508155-1-qingfang.deng@linux.dev> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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