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 7170E3B9D9D; Tue, 21 Jul 2026 21:39:04 +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=1784669945; cv=none; b=dIJFqNmbMlDHi+F8SxXBJc2Ujb8OUjxpzoEV5h7viecp4y1N8SPJYQzsanL+0mY8g8YGQJU7LBAV4ZwZTv2c2icexkTbVxRWI/Mp00PgugtlPZCgMKz/77K/nZkhtDKt0BPicn/o2WYPhwWYGnDaf2EJpZ4BwMXPjKJuS2QzL24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784669945; c=relaxed/simple; bh=kUNNWzWuPH+YAnNiRdEW7UoKv1pYrr/sbhnZQE/yAHM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dqsE0AKhZx+vW+rqzFxgCbwwflgG8FjPCLYKW4j6Vdh8l8RE8L7cngpKzcnPjIvGsQcD+tE59d8Ef1DdkJtPBwOPdYG4BH8cZY4Q8546lsAUVKm6eQjhO+n8hO7rOQKcja/IPz1KKK8dzBX7Lsq31+SBHX7L3K8h7I/cXRCeQFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QdDv504h; 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="QdDv504h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E03601F000E9; Tue, 21 Jul 2026 21:39:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784669944; bh=ud1IUYCyP1Uvf02fMiNjvbjeWHO6LxzT0vh358gJ5/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QdDv504hAvCAV7DZXwgJUJos4/YE4vNuYnMz4OY+dkpjDR8i15lTuooWz2htOrJf7 rOgQQrKmGOlBnjGvSkgPCddqFpIsXc0QcUe9XGAXfKYvjMFOnVYBypaH4xNIKh6TB0 IZrq6fepV6IU6+E4b3/amvVrOS0gaBNOU/7fk7rU= 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.1 0744/1067] netfilter: xt_cluster: reject template conntracks in hash match Date: Tue, 21 Jul 2026 17:22:25 +0200 Message-ID: <20260721152441.223684475@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@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.1-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)