Linux Netfilter development
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: conntrack: check NULL when calling nf_ct_ext_find()
Date: Mon, 8 Jun 2026 23:26:29 +0200	[thread overview]
Message-ID: <aiczgrv5J-m-7jo8@strlen.de> (raw)
In-Reply-To: <20260608212120.68828-1-pablo@netfilter.org>

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> nf_ct_ext_find() might return NULL since ct extensions may be declared
> stale because of object dependencies or modules that are going away.
> 
> When helper is removed, nf_ct_iterate_destroy() unhelps the conntrack
> entries. Then, the nf_ct_ext_find() might return NULL if the extension
> is stale for unconfirmed conntracks if the genid validation fails.
> 
> Add the null check to:
> 
> - nfct_help()
> - nfct_help_data()
> - nfct_seqadj()
> 
> that call this function since packet path could be walking over helper
> while it is being removed.
> 
> While at it, fetch ct helper area in nf_ct_expect_related_report() only
> once and pass it on to other ancilliary functions. Replace WARN_ON()
> by WARN_ON_ONCE() in nf_ct_unlink_expect_report().
> 
> Fixes: c56716c69ce1 ("netfilter: extensions: introduce extension genid count")

I'm not sure this tag is correct.

The genid checks are only for unconfirmed entries, not in hash.

nfct_help() and nfct_help_data() can return NULL as you say, but
I don't see how this relates to the above commit either.

That said, I agree with the patch.

  reply	other threads:[~2026-06-08 21:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 21:21 [PATCH nf-next] netfilter: conntrack: check NULL when calling nf_ct_ext_find() Pablo Neira Ayuso
2026-06-08 21:26 ` Florian Westphal [this message]
2026-06-08 21:36   ` 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=aiczgrv5J-m-7jo8@strlen.de \
    --to=fw@strlen.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox