Article View: linux.kernel.netdev
Article #112Re: [PATCH net v3] netfilter: conntrack: avoid recursive master destruction
From: Florian Westphal
Date: Wed, 07 Oct 2026 08:48
Date: Wed, 07 Oct 2026 08:48
33 lines
6172 bytes
6172 bytes
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.
Technical Details
Message-ID:
<asYHaUFdxo0flpAe@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-342257-linux-kernel-netdev=dewy.ruReferences:
<20261007014802.2615503-1-4ncienth@gmail.com>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-342257-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 10:48:48 +0200 Organization: Usenet Network Message-ID: <asYHaUFdxo0flpAe@strlen.de> References: <20261007014802.2615503-1-4ncienth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="610811"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ChXETbz9ERUdxsBgfBDL45tfAlw= sha256:zqIMti5P8F9eNHP21Yz8oCJCuThK8olfzwF7gI9L/Ts= sha1:uYyu0a41LzMrpD1as/bgcwdFDw0= sha256:lFNPHNechCeTQFUR8Nr0+LS8Etv30xAW25S01LEJYAM= 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 463C310F113; Wed, 7 Oct 2026 11:50:00 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.951 X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=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] 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 GFYGXGXR-3tn; Wed, 7 Oct 2026 11:49:56 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-342257-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4F61C10F108; Wed, 7 Oct 2026 11:49:52 +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 2A2DE2B47C; Wed, 7 Oct 2026 08:48:57 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C926C44E66B; Wed, 7 Oct 2026 08:48:55 +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 20C8244A406; Wed, 7 Oct 2026 08:48:51 +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=1791362935; cv=none; b=gb/pqePRTF/+jORqlf309enzrj04q/6KwBkd4xkiUphntF4laYXiSluIk9XU0Dx+ZK3SAh109+qUiwAcmquH81ZmzuoXC+Ky8wOHeUYohZSOc341+24gS//+FYZjCAoINssCSD7+dmc3RgzHpAG4JvrlUCuj3uZkGkwzIQQUPyg= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791362935; c=relaxed/simple; bh=v5DhNq5+rQFKLrFNihG9VAM61iFoZKuf9uJy8//4nKs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=auxywIQ9ps0px7s2ML8j5R6duV59+Yn8/mSB1/0+QWjreWt/stXsNuxIh5w7YGqkskKF1Ok0VZI7gPITjAHerMoqsrVXEBywXENEMfQ+LRx0/aYNU0VMGxvpSN4X6Rd5ez8BGOP/Tmqu4URXkss8iOj5oIlo2vc33f+wni2v/s8= 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 422746038C; Wed, 07 Oct 2026 10:48:49 +0200 (CEST) X-Cc: pablo@netfilter.org, 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: <20261007014802.2615503-1-4ncienth@gmail.com>