Netdev List
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
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
Subject: Re: [PATCH net v3] netfilter: conntrack: avoid recursive master destruction
Date: Wed, 7 Oct 2026 13:26:27 +0200	[thread overview]
Message-ID: <asYsY-yLXNVFc_Rv@strlen.de> (raw)
In-Reply-To: <asYf2b03D78kWdkZ@chamomile>

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.

  reply	other threads:[~2026-10-07 11:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07  1:48 [PATCH net v3] netfilter: conntrack: avoid recursive master destruction Daehyeon Ko
2026-10-07  1:49 ` netdev-bot+sinfo
2026-10-07  8:48 ` Florian Westphal
2026-10-07 10:32   ` Pablo Neira Ayuso
2026-10-07 11:26     ` Florian Westphal [this message]
2026-10-07 11:45       ` 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=asYsY-yLXNVFc_Rv@strlen.de \
    --to=fw@strlen.de \
    --cc=4ncienth@gmail.com \
    --cc=coreteam@netfilter.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    --cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox