From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 935C1470444; Tue, 21 Jul 2026 19:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663537; cv=none; b=eQe75HjVsgYuLEQOwKeoCqDkx/lwoc9BGdWGWT3BgoJTycygbUFlE/RRqdvHMvBlcWxv42B94Ict8ypQHjOO2nQWYKdllosuODYUU/dRBpaeq5uqpMTFNfzwrDZz1zafOD1yulrZmQpcACg4Dxs3tZXYren5IhqNiVIV3fS1IxM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784663537; c=relaxed/simple; bh=vmyy5eMRc9rD1qXbkYwCM/9Ur4iDSUv6wzTGEM72EbA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=coTh21MAnCYqsdfNL7pXFLMGhin5R6mBQF/zALKelShznVfIN4/HchePGwQWVbipTM9ZS0lbzHRlbE3rJwU2at7dmPCzCstWGmRjNeyHfMmA7VjZnJw1hlhirjFwIPQcaf3IU4ctySpvsjwlMo4KMKTkRidnuN09ehdVkPSN0dE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qwJQhSnN; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qwJQhSnN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D2901F000E9; Tue, 21 Jul 2026 19:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784663536; bh=6fuSfHPK1godQc6rsewC5w8NwX1R01lmoAhOccX00w4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qwJQhSnNY0zzWqsT68pM1P5HZMDTOv7wuCDtSCy25jODqQ+40FP8SgKouirS78y02 WW+lGNTHwW7ZS9AfDN2fY4IGs0uo2ujrTIQSkQN/SO07V1lVjOgakmjgc4AXxPCwUt d5rilv3Ks2Jc4JfKiV9YAhobotJN9Fdg4mMbT3ss= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yuan Tan , Yifan Wu , Juefei Pu , Zhengchuan Liang , Xin Liu , Wyatt Feng , Ren Wei , Pablo Neira Ayuso Subject: [PATCH 6.12 0859/1276] netfilter: xt_cluster: reject template conntracks in hash match Date: Tue, 21 Jul 2026 17:21:42 +0200 Message-ID: <20260721152505.273094817@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wyatt Feng commit 5feba91006ec92da57acc1cc2e34df623b98541e upstream. xt_cluster_mt() treats any non-NULL nf_ct_get() result as a fully initialized conntrack and passes it to xt_cluster_hash(). This causes a state confusion bug when the raw table CT target attaches a template conntrack to skb->_nfct before normal conntrack processing. Templates carry IPS_TEMPLATE status but do not have a valid tuple for hashing yet, so xt_cluster_hash() can hit its WARN_ON() path on the zeroed l3num field. Reject template conntracks before hashing them. This matches existing netfilter handling for template objects and avoids hashing incomplete conntrack state. Fixes: 0269ea493734 ("netfilter: xtables: add cluster match") Cc: stable@vger.kernel.org Reported-by: Yuan Tan Reported-by: Yifan Wu Reported-by: Juefei Pu Reported-by: Zhengchuan Liang Reported-by: Xin Liu Assisted-by: Codex:GPT-5.4 Signed-off-by: Wyatt Feng Signed-off-by: Ren Wei Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/xt_cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/xt_cluster.c +++ b/net/netfilter/xt_cluster.c @@ -107,7 +107,7 @@ xt_cluster_mt(const struct sk_buff *skb, } ct = nf_ct_get(skb, &ctinfo); - if (ct == NULL) + if (!ct || nf_ct_is_template(ct)) return false; if (ct->master)