From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (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 2041F3AB275; Fri, 13 Mar 2026 15:07:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773414424; cv=none; b=d9BRoUByfuFj2wlV7AlUxwY7nBVJ79p6spekD97v4UfGpbWW6njZGoN9CRP+e2e4LDUkAESPpm/HicYZHkQCVczxlIkPimE1ijg0WFrMVBRp5wwaMdPI9WfXxtzSe9XZfJ6ttLu5htM67uV3axtHxyCgLUNPSk3spVKE0KMgG7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773414424; c=relaxed/simple; bh=o/Bc+2YVQTQMwIRxVwnR8SXdknWYuoB5QR6OSdxBC0c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ChucV0SYbqHM35v8vuhB29l78UYjH6POagGoNO6NzcsBMX6Hge7AdPBQEPMT8Tt8XY6sCHM9ZvOag3+nWQLV7rzXyXRcMKWKuzcArjwBH5fqMPSyiJHFNEJ1VgWjQ0mt8zS3jQI488lLzpfBxMmpSQpNjQ5eBSOUtVOPlioH3h8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc; arc=none smtp.client-ip=91.216.245.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=Chamillionaire.breakpoint.cc Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id A90E460709; Fri, 13 Mar 2026 16:07:00 +0100 (CET) From: Florian Westphal To: Cc: Paolo Abeni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , , pablo@netfilter.org Subject: [PATCH net 09/11] netfilter: xt_CT: drop pending enqueued packets on template removal Date: Fri, 13 Mar 2026 16:06:12 +0100 Message-ID: <20260313150614.21177-10-fw@strlen.de> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260313150614.21177-1-fw@strlen.de> References: <20260313150614.21177-1-fw@strlen.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Pablo Neira Ayuso 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 --- 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 3ba94c34297c..498f5871c84a 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.52.0