🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #166

Re: [PATCH net v3] netfilter: conntrack: avoid recursive master destruction

#166
From: Florian Westphal
Date: Wed, 07 Oct 2026 11:26
36 lines
5583 bytes
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > That said, ignoring the source of the problem is not good.
> > 
> > I see no point whatsoever for a expected connection to have a
> > non-control connection as its master.
> 
> I would prefer if chain length is limited too, ie. tighten this
> interface based on the LLM feedback.

Thanks, working on this now.  Tentative plan:

#define NF_CT_MAX_EXPECT_CHAIN_LEN     4

static inline bool nf_ct_master_acceptable(const struct nf_conn *m)
{
       unsigned int depth = 0;

       while (m->master) {
               if (++depth > NF_CT_MAX_EXPECT_CHAIN_LEN)
                       return false;
               m = m->master;
       }

       return true;
}

 struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me)
 {
        struct nf_conntrack_expect *new;
 
+       if (!nf_ct_master_acceptable(me))
+               return NULL;
+

I'll make an independent submission for this.
Technical Details
Message-ID: <asYsY-yLXNVFc_Rv@strlen.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342317-linux-kernel-netdev=dewy.ru
References: <20261007014802.2615503-1-4ncienth@gmail.com> <asYHaUFdxo0flpAe@strlen.de> <asYf2b03D78kWdkZ@chamomile>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342317-linux-kernel-netdev=dewy.ru
From: fw@strlen.de (Florian Westphal)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3] netfilter: conntrack: avoid recursive master
 destruction
Date: Wed, 7 Oct 2026 13:26:27 +0200
Organization: Usenet Network
Message-ID: <asYsY-yLXNVFc_Rv@strlen.de>
References: <20261007014802.2615503-1-4ncienth@gmail.com>
 <asYHaUFdxo0flpAe@strlen.de>
 <asYf2b03D78kWdkZ@chamomile>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="644261"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:NFSehlwix6UhTZ+Clmk9SG/uiFs= sha256:kXJiBkr0aEZcJV2xWoC3dDfs4QPmOR8a6UL8GEFXHbw=
	sha1:T1dXHZ9AWDVlhPP/T89t2sOL08A= sha256:uIn8euvNQSQQeBrfAb8xAt8I/wec0X+TT0O75nON614=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 2E7E010F152; Wed,  7 Oct 2026 15:43:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.751
X-Spam-Status: No, score=-0.751 tagged_above=-9999 required=6.31
	tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 81NCS98hWULx;
	Wed,  7 Oct 2026 15:42:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342317-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=strlen.de
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 3D2E510F0D1; Wed,  7 Oct 2026 15:42:53 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id 4F23A611B26; Wed,  7 Oct 2026 11:33:37 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id DC75D466B00;
	Wed,  7 Oct 2026 11:26:50 +0000 (UTC)
X-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 4920E451984;
	Wed,  7 Oct 2026 11:26:35 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791372410; cv=none; b=DGWxOc5hFtREUYRVlu7IOdp+yZJ1rWKeeRj6tKI+1Zg5kupX7TKv5yu57KrW9XI6qDvK55A5FUTG8BvK87xK8HfefF5Gl8GWI35/8S775o2JELYCaUJ1dKVV9/sgkC+KgrXrZYLahR44ymThkIgqKmvkTFHYKuJaYY8/Q9bVKb4=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791372410; c=relaxed/simple;
	bh=nNz+2pukxDgm4VGMq38mx9djubvzUb0FJlvPkBsqTEs=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=t29EAtNEp4UVGMn5JXlu8pekQE5NwCxMMqfP2tkVXiXBtapjk1zUi5oVO1zL2fItcjZQkqZNBfGZa7O83YUB5u5xD2Td05q3VkW8eeISgHw190eNy2NqKwnWvVh8AD3EM2vrGV56EDnETAAwaO4mIqUvxQlx+cQ0H30SKv0QISo=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; arc=none smtp.client-ip=91.216.245.30
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de
X-Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)
	id AA3136038C; Wed, 07 Oct 2026 13:26:32 +0200 (CEST)
X-Cc: Daehyeon Ko <4ncienth@gmail.com>, phil@nwl.cc,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, stable@vger.kernel.org
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <asYf2b03D78kWdkZ@chamomile>