From: Florian Westphal <fw@strlen.de>
To: alireza@asgari.net
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
Phil Sutter <phil@nwl.cc>,
netfilter-devel@vger.kernel.org, netdev@vger.kernel.org,
kunit-dev@googlegroups.com
Subject: Re: [PATCH RFC net 0/3] netfilter: nfnetlink_queue: handle packet ID reuse and large gaps
Date: Fri, 6 Nov 2026 05:54:33 +0100 [thread overview]
Message-ID: <au1difVZWMSV78wV@strlen.de> (raw)
In-Reply-To: <20261106-nfqueue-review-v1-0-b6c933f44943@asgari.net>
Alireza Asgari via B4 Relay <devnull+alireza.asgari.net@kernel.org> wrote:
> This series addresses packet-ID reuse and batch-verdict ordering in
> NFQUEUE. I am posting it as an RFC to discuss the handling of ambiguous
> batch boundaries and the additional sequence state used to resolve them.
-v. I see 0 bugs here. Only lots of code churn.
> An old packet can remain queued while newer packets receive individual
> verdicts.
Not really, that would be a userspace bug. Its not adviseable to do
out-of-order verdicts. I know some people do that though :-/
> Queue length therefore does not bound the distance between
> pending packet IDs. After a complete 32-bit ID cycle, two pending packets
> can have the same ID, making verdict lookup ambiguous. Even before reuse,
> the signed 32-bit comparison in the batch handler can select the wrong
> FIFO prefix when IDs are separated by half an ID cycle or more.
WTF, whats the point of doing that?
> Patch 1 rejects an incoming duplicate ID before list insertion or userspace
> notification, preserving the existing pending packet. The incoming packet
> follows the existing enqueue-failure policy: drop by default, or accept
> with FAIL_OPEN.
OK, but really... who needs this?
> Patch 2 uses an exact queued boundary to select the FIFO prefix. For a
> boundary no longer queued, it uses a 64-bit queue sequence and a per-entry
> 32-bit epoch to recover issuance order. Ambiguous missing boundaries
> return -ERANGE without changing the queue. The wire format is unchanged,
> but the rejection behavior is userspace-visible. This does not distinguish
> stale verdicts after an ID has been released and reused.
Insane... tons of code added for what? Batch verdicts are incompatible
with out-of-order verdicts. I fail to understand why the kernel needs
to become more complex and more complex and more complex.
LLMs make it oh-so-easy but whats left is even more unmaintanable than
the current state.
> I would appreciate feedback on:
>
> - Whether -ERANGE with the queue unchanged is the appropriate response
> for an ambiguous missing batch boundary.
> - Whether the per-entry epoch and widened queue counter are appropriate
> for handling boundaries that have already been removed.
Sorry, I have no idea what these patches should accomplish.
> - Whether the existing drop/FAIL_OPEN policy is the preferred way to
> handle an incoming packet whose ID is still pending.
That one is fine, even though I would really like to understand what use
case requires holding on to a packet for 2**32 (!) Ids to pass.
next prev parent reply other threads:[~2026-11-06 4:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 0:37 [PATCH RFC net 0/3] netfilter: nfnetlink_queue: handle packet ID reuse and large gaps Alireza Asgari via B4 Relay
2026-11-06 0:37 ` [PATCH RFC net 1/3] netfilter: nfnetlink_queue: reject duplicate pending packet IDs Alireza Asgari via B4 Relay
2026-11-06 0:37 ` [PATCH RFC net 2/3] netfilter: nfnetlink_queue: fix batch verdict ordering across large ID gaps Alireza Asgari via B4 Relay
2026-11-06 4:45 ` Florian Westphal
2026-11-06 0:37 ` [PATCH RFC net 3/3] netfilter: nfnetlink_queue: test packet ID ordering and collisions Alireza Asgari via B4 Relay
2026-11-06 0:41 ` [PATCH RFC net 0/3] netfilter: nfnetlink_queue: handle packet ID reuse and large gaps netdev-bot+sinfo
2026-11-06 4:54 ` Florian Westphal [this message]
2026-11-06 9:46 ` Alireza Asgari
2026-11-06 14:55 ` Florian Westphal
2026-11-06 15:42 ` Alireza Asgari
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=au1difVZWMSV78wV@strlen.de \
--to=fw@strlen.de \
--cc=alireza@asgari.net \
--cc=kunit-dev@googlegroups.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
/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