Article View: linux.kernel.netdev
Article #145Re: [PATCH net v3] netfilter: conntrack: avoid recursive master destruction
From: Pablo Neira Ayuso
Date: Wed, 07 Oct 2026 10:32
Date: Wed, 07 Oct 2026 10:32
37 lines
7474 bytes
7474 bytes
On Wed, Oct 07, 2026 at 10:48:48AM +0200, Florian Westphal wrote:
> Daehyeon Ko <4ncienth@gmail.com> wrote:
> > A conntrack holds a reference to its master. Userspace can build an
> > unbounded acyclic chain through ctnetlink. Expectation producers can do the
> > same: an nft ct expectation can attach its helper to an unconfirmed
> > expected child and arm the next expectation with that child as master. The
> > H.323 Q.931 helper can also propagate itself through call-forwarding
> > expectations.
> >
> > When only child-held references remain, destroying the leaf calls
> > nf_ct_put() on its master. If that was the final reference, nf_ct_put()
> > recurses into nf_ct_destroy(). Repeating this at each level exhausts the
> > task stack and panics.
> >
> > Nested expectations are existing helper semantics, and CTA_TUPLE_MASTER
> > was introduced for conntrackd state replication. Avoid per-producer
> > restrictions. Decrement the master's refcount directly, then free the
> > current conntrack. If the refcount reached zero, continue destroying the
> > master in the same invocation. This preserves existing constructors while
> > bounding stack use.
> >
> > Fixes: 5faa1f4cb5a1 ("[NETFILTER]: nf_conntrack_netlink: add support to related connections")
> > Cc: stable@vger.kernel.org
> > Link: https://patch.msgid.link/179127347858.434549.11821822167265441355@kernel.org
> > Assisted-by: LLM
> > Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
>
> Acked-by: Florian Westphal <fw@strlen.de>
>
> 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.
Technical Details
Message-ID:
<asYf2b03D78kWdkZ@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-342309-linux-kernel-netdev=dewy.ruReferences:
<20261007014802.2615503-1-4ncienth@gmail.com> <asYHaUFdxo0flpAe@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-342309-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 12:32:57 +0200 Organization: Usenet Network Message-ID: <asYf2b03D78kWdkZ@chamomile> References: <20261007014802.2615503-1-4ncienth@gmail.com> <asYHaUFdxo0flpAe@strlen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: usenet.network; logging-data="627741"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mVd8tpw1l50gs/APR4eYMRsCBlA= sha256:cio9c0G8J+6yTCjN0GvqFUZQJ120qs9qp8jai5LkK8g= sha1:LMP7MrCLLtZFZ8LFYASrfwYGLXk= sha256:LH0fsrV62AhJyH/O1EyE2NMmu/eU0cCj/Ai6SVbeEYM= 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 98DAA10F139; Wed, 7 Oct 2026 13:42:27 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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 OmLBTpBCgWNb; Wed, 7 Oct 2026 13:42:20 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-342309-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E42CE10F0D1; Wed, 7 Oct 2026 13:42:13 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 979423458A; Wed, 7 Oct 2026 10:40:10 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14BF3489FDD; Wed, 7 Oct 2026 10:33:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.b="eguR0bk8" 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 A85C242589D; Wed, 7 Oct 2026 10:33:02 +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=1791369211; cv=none; b=lHJrFOwG9mLJwNMZ4s/cCH8Edpq9jDQVswQJiUt8dhvNeMFAfUN/frcWFPwklrzGKBgR9eTmgwGW4LOVU6eMl4f3rj/XtKAipaxTLN/i/mvVxPMmpm017zF6IaDadO2L85job0U5CU9tRHYQEXZgDmEiM/oQAm5ZYTC2kEY+uec= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791369211; c=relaxed/simple; bh=Oss9FQselWLXErgny9aGNjfvdLJxM9GTn3sJgeEE2DA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rBCLK2FupP9MEp/94ZUJb1m30hxcudwqL9+GB1mEijgVns+vfeLfl2K5UVvm5piz2qT3VYuEw9r46vKO51Ld+pPbwjE7nEk+wZ2mzlro7JfCH+Q/ihAaV/jsKTdy69kI+5+nLwK7rxDaSZs5sQmlB7uq9am+7f1KPcyFx69mGPw= 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=eguR0bk8; 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=1791369179; bh=1tCyT26DD3gNFqw8L0p1xFXxnJ6kCxscpDlQYUxpprQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eguR0bk8CaqoNFPhya3ITqbYSWuG5BRcg6UM83XYuTRFeDY3NozAa4eH8ByirKpjs fNq1ZGuUNOd630hSbDLl8JqgdAenZD3OmqrJDjdyuy/d7l8g1cvTtvisjZ1F6MiYoj MkgwpIc9U+YeWwvI8penaqAA9i6JG9lyIX5lnNllM/yenuIkwiMzBZK9Dzw+cjv+du RSIHkmZwL46C+7iT8S5NGMwm1HW5V0uhi69iV2yDAcRguo8vV0Ka0FTTL19W7zUvFw LryTQVRsffKlaA5RtsqZyxPqH2dcAC3qK9RPahIGrGdrmIP1GrNqNlhxy4WqqiyZdn e6gUyA/NQqPfg== X-Received: from netfilter.org (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with UTF8SMTPSA id D33F060058; Wed, 7 Oct 2026 12:32:59 +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: <asYHaUFdxo0flpAe@strlen.de>