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 C74EC45DF7E; Tue, 21 Jul 2026 22:18:26 +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=1784672308; cv=none; b=m0r9TwZn//eORMytLwDoZFd8oqlFIJC3eMrFJ75ocMWIKUE6FwDyjZwTWpe+9NGlFfk86woOyLLnfMuZLB057UHuZ0DOqSyjd0P2jYS7VfmvTp2qF43W48voAQcUdoptDn+Lvdi3BsHNh42mCxjP5QZlf7vvtm3o4KRmQpHcUg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784672308; c=relaxed/simple; bh=J7mIQ/DFOE39T2jviNaLDCG0lVpSezObjblN1dR3yNo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A3jiAlPw5JkWezJp8GJ2dEiK2TO6AE9Mouw67Vk41MT5YqsXVXqnIzdg8weTVqH+ixkmrNU0TXZwuokcLc2p8+jsvp9fvlfwjbSkv8eZUwdjUpoU7WTwH55XCWdP2TQ21c3e9GW+FmpgAFhsRGQ8y1WoZ1MIC7/jePOlS7kU5yo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Yu4dE0UZ; 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="Yu4dE0UZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C0341F000E9; Tue, 21 Jul 2026 22:18:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784672306; bh=CP2d/jfTbAzQgRvOhUvsJIKoDywGBv3l0NYoTQYdDvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Yu4dE0UZT9x1DCzqdVZ0Hq5qA9b/GbS1rQQJ/UYnrXs3mK/Hu6cXRJfeKOrX+egyc 41M/wtmIU5iVUufM7VdOHcx03szEMRsYQkGjf7D0PVjKY0OnKgUOzIchNwVOpK8kFJ k1ZfW2tCumQ0LlqOeQa5ogvfKbWYK8IujCS1bw+Q= 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 5.15 574/843] netfilter: xt_cluster: reject template conntracks in hash match Date: Tue, 21 Jul 2026 17:23:29 +0200 Message-ID: <20260721152418.958807488@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152405.946368001@linuxfoundation.org> References: <20260721152405.946368001@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 5.15-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)