From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C787A1DF25C; Mon, 23 Mar 2026 13:56:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274192; cv=none; b=e62Vcok5A/Hp2FABer8XGptXZWCYwlnYTw/j1oFdXxeKiwQ5pq+dVtr5MLTSk38I7qfDIYteG0Gfdse5DtkLuKljIyf1KhlSSB5uijpa8T5lVxCbU5brJM8CSIWWegYz4CvFZfyjtFOfzwW4T1OkwBVWZcfw0zEox0Vb0pD1v24= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274192; c=relaxed/simple; bh=54IaEDziBe7iKFjDTCJuhihpGqy36qMWVbYkmw/uB4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WF62HtJiPWBKimMi7foCr8iVtISCTzPECxh1uHryC7fKPtklKoURl3SQIDIAu7mGhEW4SdncpJvu3KDisWwD4n12P35HSTcALIPy8sQby/+A1U3K8XrewXY1bWbue0in4vZyuHpC7v+J3j9Zo+Rm7qFoOPOcVKK5175DytvPzXs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2XI/2Jfg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2XI/2Jfg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F85C4CEF7; Mon, 23 Mar 2026 13:56:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774274192; bh=54IaEDziBe7iKFjDTCJuhihpGqy36qMWVbYkmw/uB4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2XI/2Jfg8RTu6XMluCyzQG72w+6QnX1sfOTf5giVX7+BdQ5BJJn2YdpKQ156wM9F6 A5J4whtJDC92d9hfvKA1aG4OZwdnB/wasOFw6BGRL3ub04dFHUKgK4odzL6LDV+i2s /MNB2HPHVGdZ5qYMnr63q86I8wFEgCK5CZ0vf2DQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yiming Qian , Pablo Neira Ayuso , Florian Westphal , Sasha Levin Subject: [PATCH 6.19 139/220] netfilter: xt_CT: drop pending enqueued packets on template removal Date: Mon, 23 Mar 2026 14:45:16 +0100 Message-ID: <20260323134508.960655975@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134504.575022936@linuxfoundation.org> References: <20260323134504.575022936@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pablo Neira Ayuso [ Upstream commit f62a218a946b19bb59abdd5361da85fa4606b96b ] Templates refer to objects that can go away while packets are sitting in nfqueue refer to: - helper, this can be an issue on module removal. - timeout policy, nfnetlink_cttimeout might remove it. The use of templates with zone and event cache filter are safe, since this just copies values. Flush these enqueued packets in case the template rule gets removed. Fixes: 24de58f46516 ("netfilter: xt_CT: allow to attach timeout policy + glue code") Reported-by: Yiming Qian Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin --- net/netfilter/xt_CT.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c index 3ba94c34297cf..498f5871c84a0 100644 --- a/net/netfilter/xt_CT.c +++ b/net/netfilter/xt_CT.c @@ -16,6 +16,7 @@ #include #include #include +#include "nf_internals.h" static inline int xt_ct_target(struct sk_buff *skb, struct nf_conn *ct) { @@ -283,6 +284,9 @@ static void xt_ct_tg_destroy(const struct xt_tgdtor_param *par, struct nf_conn_help *help; if (ct) { + if (info->helper[0] || info->timeout[0]) + nf_queue_nf_hook_drop(par->net); + help = nfct_help(ct); xt_ct_put_helper(help); -- 2.51.0