🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #11992

Re: [PATCH RFC net 0/3] netfilter: nfnetlink_queue: handle packet ID reuse and large gaps

#11992
From: Florian Westphal
Date: Fri, 06 Nov 2026 04:54
57 lines
9510 bytes
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.
Technical Details
Message-ID: <au1difVZWMSV78wV@strlen.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357738-linux-kernel-netdev=dewy.ru
References: <20261106-nfqueue-review-v1-0-b6c933f44943@asgari.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357738-linux-kernel-netdev=dewy.ru
From: fw@strlen.de (Florian Westphal)
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <au1difVZWMSV78wV@strlen.de>
References: <20261106-nfqueue-review-v1-0-b6c933f44943@asgari.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="3796169"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:XrBcyPU2McQsE6n/QPaQjXIUXB0= sha256:yuOgCbZ9JWNU/yeUDvfNmOrK4KutL6KIDPxM17jhLFk=
	sha1:Mk8QzaYDHbxXqyG8UcU1qrjQIKU= sha256:uSLyHJNiJ0+NYhgnAMQB/Tezw8ixAecruvNvz3l94GY=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id E8BE3113155; Fri,  6 Nov 2026 07:55:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id fylQ5jI3OSwC;
	Fri,  6 Nov 2026 07:55:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-357738-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=strlen.de
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 1BFB6112EA9; Fri,  6 Nov 2026 07:55:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 58919600FC6; Fri,  6 Nov 2026 04:54:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793940878;
	b=JJRJZd4NpNAz0Glyo2kLQPy1tuZt74aK5mEsLNja1oo0glOrPfSKV5lCe+Bewit7Y7t2
	 XxEqHA3oI1iYMyI5PAFRVwz9JlDAXMaY20i3yxPkig3B7Qkc9J4Xn7qihrZ3LsqAQaGXH
	 sZziD+Lq7I8fk9+D7SVy/gQx1eMihCGc+7NTXCe8EAONSur+Nx7ao4ZcjgK0VTAZp32zE
	 3/QOLYfK837mLTw+qQXR0xIZnlIxMIYjQ7waZqbjQkB4tDP5s2sQlEz+kg3dBhfcE0tCV
	 PvgsAeexTklqwCqxCpHnizKiitVsWCKDMEnk/yl8SVaf5yeIuzRDU+FOx2KN03gbEEA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793940878;
	h=X-Original-To:Received:DMARC-Filter:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To;
	bh=aFtEo7AVor9n5wvSOp0oeze4IpinGPPlnbyoG7+pTWc=;
	b=1S2xffsIgirB1JZcDnA3f0y4khLynGFt0AmmAoJS10UpEPRLI8TGxT2IUnxpWkAPokRg
	 nT8dB6w2imhXtl2CGpZZ25f1+BDYWIvaaJGuyfqisuvzULRpHg5xaQEHUZVyd+yvzAOw4
	 WzIoriaJ0uKB+CqZilUTU9YJ29EBfMhVqKVQH8bE/R69oVGeq8oS/VpzCKAhU3o5nyp8P
	 gMpwEC/8o6awqOpbnPldV2c+N3mx/h9sChIwwb+nwot6eUXLFQ88myz1tQiqfYDD7917I
	 I+dVr8nSTk8zU7tpKs/VSeolgtzLqe0CVRgS4WPUBhBLojuIvEqDAIfXIkeRNfjD30Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=strlen.de;
	spf=pass smtp.mailfrom=strlen.de;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C866606A33A;
	Fri,  6 Nov 2026 04:54:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.216.245.30
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793940877;
	b=4p4zGlIx0JunKim/ASpUdIw8D/fRxiJagkQDC4eDpiScUsWbdN6AGK0iT62vgXa+C2O8
	 rn2ply5vhOTbrUaT2N3dy3QYNRWnrQq0xPTzhVWqgbSnNoyeMsPrY0xKcXsyCTe3KT5Xe
	 MwQXv2YpOg8Pi6ll3m5ao8jqYenGxxxdeQwwWC/kHXECDazoa9oYmPNlcGDZnppifnyO2
	 LregPriOltLYREBmWx7SH3xzhi0K4jMqWKnVDqJb/M9mcNkqS8mPMHpJ5pFubLIBP8Ew6
	 nzDHJKWLpdJU23OZUmHjOQw0aC5h04v026sEbBBPj5MEtilJQRNhNwHDsT8LsCc7r4g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793940877;
	h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=aFtEo7AVor9n5wvSOp0oeze4IpinGPPlnbyoG7+pTWc=;
	b=uCF7EZRc3CQ+aKdAqw2dWyU4kfixLVLR+4e4eQ6krsWAlpEnw+SwlGaW62pvwRiJEYXh
	 emCIURHGAX6jpwOxqi/lw9KsD/Am3h+iirfCJKxidEDjIN2ETTRgBzQQesrE1tQxKVU+D
	 6sFWwFqkVXWjNeJ0NEL8rnWMHi/KRrGOIkX3Zj62NCkA4qrDgHesktDxtCVQzt609lXjo
	 OgkXVE6nY9b/yzs9nSedLqNyG0udEQ9muw7oJOAvhMKKv+ceJjKfJn598h/drIKltx/ql
	 LSzEEKgv+CakeTOq8O1SAag7rMvhwf/SJHqHtUxS6svz8YkDQ5X9kdm5Rl6tDf/r7+A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=strlen.de;
	spf=pass smtp.mailfrom=strlen.de;
	arc=none smtp.remote-ip=91.216.245.30
X-Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7072B606A31B;
	Fri,  6 Nov 2026 04:54:36 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7072B606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de
X-Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003)
	id 380246060B; Fri, 06 Nov 2026 05:54:34 +0100 (CET)
X-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
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261106-nfqueue-review-v1-0-b6c933f44943@asgari.net>