From: Florian Westphal <fw@strlen.de>
To: Scott Mitchell <scott.k.mitch1@gmail.com>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org
Subject: Re: [PATCH v6 1/2] netfilter: nfnetlink_queue: nfqnl_instance GFP_ATOMIC -> GFP_KERNEL_ACCOUNT allocation
Date: Mon, 19 Jan 2026 01:39:44 +0100 [thread overview]
Message-ID: <aW19UIm96f43DyB-@strlen.de> (raw)
In-Reply-To: <CAFn2buCeCb1ZiS0fK9=1RZS3WOSLcdwV1c06JEFbgXTQCTVW1A@mail.gmail.com>
Scott Mitchell <scott.k.mitch1@gmail.com> wrote:
> On Sat, Jan 17, 2026 at 2:45 PM Florian Westphal <fw@strlen.de> wrote:
> >
> > scott.k.mitch1@gmail.com <scott.k.mitch1@gmail.com> wrote:
> > > + /* Lookup queue under RCU. After peer_portid check (or for new queue
> > > + * in BIND case), the queue is owned by the socket sending this message.
> > > + * A socket cannot simultaneously send a message and close, so while
> > > + * processing this CONFIG message, nfqnl_rcv_nl_event() (triggered by
> > > + * socket close) cannot destroy this queue. Safe to use without RCU.
> > > + */
> >
> > Could you add a
> >
> > WARN_ON_ONCE(!lockdep_nfnl_is_held(NFNL_SUBSYS_QUEUE));
> >
> > somewhere in this function?
> >
> > Just to assert that this is serialized vs. other config messages.
> >
> > Thanks.
>
> Will do! Does the overall approach make sense?
I don't see any problem with this patch. nfqnl_rcv_nl_event()
cannot run at same time for this socket; it would already be a
problem for the existing code, parallel event+queue unbind
would result in double-free.
So the comment makes sense to me.
next prev parent reply other threads:[~2026-01-19 0:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-17 17:32 [PATCH v6 0/2] netfilter: nfnetlink_queue: optimize verdict lookup with hash table scott.k.mitch1
2026-01-17 17:32 ` [PATCH v6 1/2] netfilter: nfnetlink_queue: nfqnl_instance GFP_ATOMIC -> GFP_KERNEL_ACCOUNT allocation scott.k.mitch1
2026-01-17 22:45 ` Florian Westphal
2026-01-17 23:25 ` Scott Mitchell
2026-01-19 0:39 ` Florian Westphal [this message]
2026-01-23 14:02 ` Scott Mitchell
2026-01-17 17:32 ` [PATCH v6 2/2] netfilter: nfnetlink_queue: optimize verdict lookup with hash table scott.k.mitch1
2026-01-17 23:00 ` Florian Westphal
2026-01-21 15:25 ` Scott Mitchell
2026-01-21 15:49 ` Florian Westphal
2026-01-23 1:58 ` Scott Mitchell
2026-01-23 6:54 ` Florian Westphal
2026-01-23 13:38 ` Scott Mitchell
2026-01-24 16:48 ` 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=aW19UIm96f43DyB-@strlen.de \
--to=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=scott.k.mitch1@gmail.com \
/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