From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: nfnetlink_queue: hash queue instance by portid too
Date: Thu, 17 Sep 2026 10:54:22 +0200 [thread overview]
Message-ID: <aquqvnzVYmnEISp5@chamomile> (raw)
In-Reply-To: <aqtuUg-rFmUZYoD0@strlen.de>
On Thu, Sep 17, 2026 at 06:36:34AM +0200, Florian Westphal wrote:
> Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > netlink_release() calls netlink_remove() before delivering the
> > NETLINK_URELEASE event. And a new queue instance can be created before
> > delivering such NETLINK_URELEASE event. This allows for two different
> > queue instances with the same portid to co-exist for a little while.
> > Since the instance that is going away is destroyed by portid via netlink
> > notifier, both the newly created instance and the one that is going away
> > with the same portid are destroyed.
> >
> > Fixes: 7af4cc3fa158 ("[NETFILTER]: Add "nfnetlink_queue" netfilter queue handler over nfnetlink")
> > Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> > ---
> > @Florian: this is the rare race that Clashiko uncover with your fix.
> > This is a pre-existing issue. I have to check if nfnetlink_log
> > is also affected.
>
> AFAICS its complete bullshit report.
It's theoretical, yes.
> Needs threads that race to kill and resurrect the same queue all over
> again, constantly.
I think this can happen with different queue number and same netlink
portid.
> Don't do that, then?!
> What kind of userspace does this?! I mean, what's the point?
The goal of my patch reject duplicates netlink portid.
> We could make nfqueue refcounted, like _log, but I see no reason
> whatsover.
I don't see how refcounting will fix this race.
The problem is that the netlink notifier path encounters two different
queue instances with the same portid, and it destroys both of them,
the new and the stale one.
next prev parent reply other threads:[~2026-09-17 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 22:00 [PATCH nf-next] netfilter: nfnetlink_queue: hash queue instance by portid too Pablo Neira Ayuso
2026-09-17 4:36 ` Florian Westphal
2026-09-17 8:54 ` Pablo Neira Ayuso [this message]
2026-09-17 9:30 ` Florian Westphal
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=aquqvnzVYmnEISp5@chamomile \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@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