🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #156

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

#156
From: Pablo Neira Ayuso
Date: Wed, 07 Oct 2026 11:45
45 lines
7131 bytes
On Wed, Oct 07, 2026 at 01:26:27PM +0200, Florian Westphal wrote:
> 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

4 is a reasonable number, but I think 2 is just enough, which is what
H.323 and SIP need, in case you consider tightening this even further
Userspace helpers are simple, they don't use this feature. It is true
that conntrackd needs this feature for flow synchronization as the LLM
suggests.

> 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.

Thanks Florian.
Technical Details
Message-ID: <asYw7Pn4qcYt4F0D@chamomile>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342320-linux-kernel-netdev=dewy.ru
References: <20261007014802.2615503-1-4ncienth@gmail.com> <asYHaUFdxo0flpAe@strlen.de> <asYf2b03D78kWdkZ@chamomile> <asYsY-yLXNVFc_Rv@strlen.de>

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-342320-linux-kernel-netdev=dewy.ru
From: pablo@netfilter.org (Pablo Neira Ayuso)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3] netfilter: conntrack: avoid recursive master
 destruction
Date: Wed, 7 Oct 2026 13:45:48 +0200
Organization: Usenet Network
Message-ID: <asYw7Pn4qcYt4F0D@chamomile>
References: <20261007014802.2615503-1-4ncienth@gmail.com>
 <asYHaUFdxo0flpAe@strlen.de>
 <asYf2b03D78kWdkZ@chamomile>
 <asYsY-yLXNVFc_Rv@strlen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="639754"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:c0PMsTxKQIj14Zyu5JdXYcxS9Yk= sha256:mnrEeZWoE+uJpY8aN3jnnEfZO43f4hyMmTthkHFAjNY=
	sha1:zM5IKmJ87eSAzl+JXlzS7hJPXVY= sha256:ko10WYa/wbnmK7wOQbsyk3lVIN0HM+ngzxPRh8fbAqE=
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 6B82010F146; Wed,  7 Oct 2026 15:07:19 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=netfilter.org
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 ecnAt7kDZYnX;
	Wed,  7 Oct 2026 15:07:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342320-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 6CE9410F101; Wed,  7 Oct 2026 15:07:13 +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 7AD5C610377; Wed,  7 Oct 2026 11:50:47 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E4F1484888;
	Wed,  7 Oct 2026 11:46:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.b="TFdedxco"
X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124])
	(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 AC79A4AA008;
	Wed,  7 Oct 2026 11:45:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.190.124
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791373565; cv=none; b=OHHORHgS10ovDw7IvDE813O2ndNkX8FfVNRmOcZS1X2874QK70eEY26KBmQeFbp20QgPGObApWcAAicRCX4AXyWJzSdBfdkPI9AvhmqWW/so+dmUQUFguZ/OYtaY1bAOf5HJguQQQHH58y9neDgJvTcpVWgfdhiAgiduwROwEok=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791373565; c=relaxed/simple;
	bh=A6tOIZbTY7Ir2yMBpECPAf35YzauEeh8Ul/eEaRDFio=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=iGn9Qio7E+6Y/osMudM+XECrwDKbXgjmlb3k8PKzHRWwimRyI5ylKQ/J/6MkUFakNqQjllapnEveFyuSoxJom0wAiGWGIqLCy5W6PSBL0ysYs8vX1W3KgZ9kqLAdqpwB6YLRT/nftCOxdcrNsiY8FVaM2P1l1pFxFzLTB7RqElo=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.b=TFdedxco; arc=none smtp.client-ip=217.70.190.124
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;
	s=2025; t=1791373551;
	bh=AIOYN1lNQIGwAoqoixkSzTyR/REwoiCMp77/f+DhiGY=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=TFdedxcoRROhtHPYDHkxi5WiwtnndH4OztOPCYyrLL91djjMklyAgHIL7lGM5Pora
	 ZBIVIC2Dm4pQpGacHyPnUYgCbcJ3DqmnTw55a4vc6HC9bMUrEBKjOBKsVh+NjDmFmN
	 ubOF2mnoR8gZqhGFCjOIxXob9cx0KB4fMscXOk2nnvKiDDWR3RCjgGYE6UO0O96a2S
	 cjO7ajTPlz74J5kCLUsr1Gew2EOi0/hFOUOyKAuO2vvqIjRStaIfs+YngoVhmMn6ju
	 11V00vQvdciQoOGvYwz4niRFsvso+QNix2a+VqIYgQYOaX4pIk70gBzynxSJkflGWq
	 aB63Pey0dGrAw==
X-Received: from netfilter.org (mail-agni [217.70.190.124])
	by mail.netfilter.org (Postfix) with UTF8SMTPSA id 327DC60051;
	Wed,  7 Oct 2026 13:45:51 +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: <asYsY-yLXNVFc_Rv@strlen.de>