All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Daehyeon Ko <4ncienth@gmail.com>
Subject: Re: [PATCH nf v2] netfilter: nf_conntrack: limit expectation master chain depth
Date: Fri, 13 Nov 2026 02:46:26 +0100	[thread overview]
Message-ID: <avZr8lPA-bN9Z9_t@strlen.de> (raw)
In-Reply-To: <avZRah74LdH7P9LH@chamomile>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Tue, Nov 10, 2026 at 02:34:43PM +0100, Florian Westphal wrote:
> > A conntrack can point to a master conntrack, which itself may point to
> > another master, and so on.  There is currently no bound on how deep this
> > chain can grow.
> > 
> > Force a max depth in nf_ct_expect_alloc(): walk the master chain and
> > reject allocation if it would exceed 8 levels of nesting.
> > 
> > Also add ctnetlink_find_get_master and use it so that ctnetlink create
> > paths return -EMLINK instead of falling through to nf_ct_expect_alloc()
> > and returning a misleading -ENOMEM.
> > 
> > This prevents unbounded ct->master->master->... chains.
> > 
> > This also restricts the number of call forward/redirects that h323 and sip
> > helpers will follow.
> 
> "Should ctnetlink_glue_attach_expect() or ctnetlink_alloc_expect() also
> check nf_ct_master_acceptable(ct) and return -EMLINK?"

I saw that but there are many patches in flight in this area, so I don't
want to meddle with those.

> It would be great to collapse this patch to v3 too:
> https://patchwork.ozlabs.org/project/netfilter-devel/patch/20261101225435.447072-1-pablo@netfilter.org/

?

Not following.

ct_expect_help() calls nf_ct_expect_alloc(), so I don't see how nft_ct
can create long chains after this patch.

  reply	other threads:[~2026-11-13  1:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 13:34 [PATCH nf v2] netfilter: nf_conntrack: limit expectation master chain depth Florian Westphal
2026-11-12 23:53 ` Pablo Neira Ayuso
2026-11-13  1:46   ` Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-03 13:18 Florian Westphal
2026-11-10  1:16 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avZr8lPA-bN9Z9_t@strlen.de \
    --to=fw@strlen.de \
    --cc=4ncienth@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.