🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21440

Re: [PATCH net-next v19 15/15] quic: add packet parser base

#21440
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 01:21
91 lines
11582 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] When ALPN demux is enabled, a valid ClientHello with an ALPN
  extension longer than 128 bytes is silently dropped, so that client…

--

quic: add packet parser base

This patch adds RX packet parsing for QUIC. Sockets are looked up by
connection ID and address, and Initial packets are decrypted to pull ALPN
out of the TLS ClientHello so the right listener can be selected. It also
adds ICMP PMTU handling, deferred packet processing, and the request sock
and backlog infrastructure for incoming connections.

> diff --git a/net/quic/packet.c b/net/quic/packet.c
> index b6f76681b6902..919745d954403 100644
> --- a/net/quic/packet.c
> +++ b/net/quic/packet.c

[ ... ]

> +	/* Read TLS extensions length (2 bytes). */
> +	if (!quic_get_int(&p, &len, &length, 2))
> +		return err;
> +	if (len > (u32)length) /* Limit len to extensions length if larger. */
> +		len = length;
> +	while (len >= 4) { /* Scan extensions for ALPN (TLS_EXT_alpn). */
> +		if (exts++ >= TLS_MAX_EXTENSIONS)
> +			return err;
> +		if (!quic_get_int(&p, &len, &type, 2))
> +			break;
> +		if (!quic_get_int(&p, &len, &length, 2))
> +			break;
> +		/* Incomplete TLS extensions: skip ALPN demux. */
> +		if (len < (u32)length)
> +			return 0;
> +		if (type == TLS_EXT_alpn) { /* Found ALPN extension. */
> +			if (length > QUIC_ALPN_MAX_LEN)
> +				return err;

[Severity: Medium]

Is returning err the right choice in quic_packet_get_alpn() when the ALPN
extension is longer than QUIC_ALPN_MAX_LEN (128)?

RFC 7301 defines ProtocolNameList<2..2^16-1>, so a ClientHello that offers
more than 128 bytes of protocol names is still well formed.

Other cases this parser cannot demux return 0 and keep the current
listener. Those cases are a missing CRYPTO frame, a non-zero CRYPTO offset
and incomplete extensions.

The caller, quic_packet_listen_process(), frees the skb on any error:

	err = quic_packet_get_alpn(skb, &alpns);
	if (err) {
		kfree_skb(skb);
		return err;
	}

With quic_alpn_demux_key enabled, would this drop the client's first
Initial packet with no response? No request sock is created and nothing is
sent back. Each retransmit of the same ClientHello would be dropped the
same way, so the handshake would time out.

This path also does not increment any MIB drop counter. The decrypt
failure path above it counts QUIC_MIB_PKT_DECDROP.

Would it be more consistent to return 0 here and skip demux, as the
function already does for the other cases it cannot demux?

> +			len = length;
> +			found = 1;
> +			break;
> +		}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1795393690.git.lucien.xin%40gmail.com
Technical Details
Message-ID: <179548328755.3135.13551034983466058259@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369923-linux-kernel-netdev=dewy.ru
References: <5c305e22057f748d5c4d4cbc94a1e14271dbc485.1795393691.git.lucien.xin@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369923-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v19 15/15] quic: add packet parser base
Date: Tue, 24 Nov 2026 01:21:27 +0000
Organization: Usenet Network
Message-ID: <179548328755.3135.13551034983466058259@kernel.org>
References: <5c305e22057f748d5c4d4cbc94a1e14271dbc485.1795393691.git.lucien.xin@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4025243"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Qgmuan/zaFiS5HpqHNSqDe05ZVo= sha256:XJoggjUkF6PUbN6XRhN6L/KYACZWde4IanRKLBqPQok=
	sha1:0moQ2xdHTnmVRrFxSpRb1SnxhKQ= sha256:TVJpbtEoIhckZtNw7AQ0lC5SqTZ4Oi8/+coIX80SQvk=
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 B8252125DC7; Tue, 24 Nov 2026 04:21:49 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.3
X-Spam-Status: No, score=-2.3 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001,
	DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,
	SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 EgS228ryJrh8;
	Tue, 24 Nov 2026 04:21:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369923-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0F32F125DCB; Tue, 24 Nov 2026 04:21:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id AE205305C7; Tue, 24 Nov 2026 01:21:31 +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=1795483291;
	b=z1yWdHSSX/TYL7GjKM2kRXDrZBTekEUa4vxBTa2O4zlAhf0cdg790OJbT0oR728WoOXQ
	 ab0gMR5l7Gd0bjHh9Xv8eKHEN+s53vIr5hvqVZcXYQBlpsUT9iY40mPuO6rmQuO/5NtBS
	 489O2uBdLXVTb5KzhHWMBlgYhH+RZSDWiGcB/o51fzjCB2y7za5SHo+mNXoTMkMeFxsC/
	 +J7X43oLlnm2h6Mw8NpOkTV39s55Cd0IDYimHiH4dEFlnr/AGG73Z0RWOKL8OBlJTIZkb
	 zLjw44oOAgTy2cyilNiJcg4CsP+SVsrD4/hJqxer7A57GlNGvZ94dKd/pP9WcMcqk0A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795483291;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=W/aJuz7K+VVNBF83RN+QXZkBxEvensHYjepDsWDhvvY=;
	b=X2o8y8r7yzgoKlswNq2sLC4lczSEk2GKkw1AK6f4jC7lyJFdluFH+dsQvf9Q+8EupmBn
	 93ROZoiRIC7ioKVR/LBsGg6qUIC9hQvX4POsfOIEKFfX7siYoDVib4P7o4jqUx2X+ioqa
	 DXcCuQMTRs35BD6Y78RUUq4vadI6czP/NkTqdoDrjjY5AR6/qNkFW08BxTk6KjTOkoStr
	 eLpC1B/TZd19dMMi76D7m/GFEt7lyyRRzaA/UpTfjrNyrk3jOJFqgcZoeZgv5c2TUoYjT
	 7s05MJHdqo6mVlllEOe6IdC3k702CGLED1vOorXT5s80Pjv0bxTMyVZ5BlqMKkCImug==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=O6dX9b7p;
	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 48729606A330;
	Tue, 24 Nov 2026 01:21:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=O6dX9b7p
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795483290;
	b=J7CDZg0Nao//7xWCPL2744sBaSrArGdOBvsXPBNfgwy8RwH2IcqUuikq2s81zwdDMiYQ
	 /3gTC5gtu3VppOQxms0Axd3UGsgC6bbhAVnxjZsR74+rEB31mYR3nEGs2EUdUGBauv+4J
	 1qH/glrNeqY5g46+TVVM1xS7XAr8K7YFtd22tDIowqwO00AuCgjWE/E044XGl/IL/XOvq
	 hRQ41NIAmWjcFbDYXsPfFREJyUo0D9WrLtvDtM+z2mxtbYJSmHv5BXOaYd1x6Z2VlsqoU
	 3Boz5fly6CmIgsrlF7mZ/i6KvsDn1jQjS7uV0LzVUfdI6rlTDbUSBbWWX+eRteNWflQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795483290;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=W/aJuz7K+VVNBF83RN+QXZkBxEvensHYjepDsWDhvvY=;
	b=e4M6A0vt3gBqWB5Vv6Qm8uqlS6cj0SXJUvYKGjqvk9lR08rPr9FGJNJAjmOYgudnL40d
	 ojXFTiWV0s9q5VaM9ko1Zap8UgXtFWailUQi3PZtwLAkZa4kMM8IsbPT8Ak0T3Bb1KzOO
	 jo+UasV0OVxvH6hAISPzVsorYp0vJYSokFF1xWILITtZRyC3Dr/7jvauWAIqlITUwomwD
	 X+ITzEcdi/zdweKmQnebEKzYu77imtMMFT1fywPo72WMFcp9tciZczT4rOwpx4ws1OB+s
	 w3rTzd1JPbXHwhCn9znyocXRqHrgPOXxo5Hr1HEtSyEXG0Nk0UII+o3MrAT4uJNfZXg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=O6dX9b7p;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67B75606A321;
	Tue, 24 Nov 2026 01:21:30 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC6671F000C0;
	Tue, 24 Nov 2026 01:21:27 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795483289;
	bh=W/aJuz7K+VVNBF83RN+QXZkBxEvensHYjepDsWDhvvY=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=O6dX9b7pqSkKLFElzCIh7pJ/BhgMH58hvd38nQpgB/UvjnMErR0kJ9Li6vdKxpSzb
	 aiSfZhdNrLR5lDrBb4Q0gicGkpT4ofZvW3UgKhbKzWsYEZUbAbeoFaJAsL28KUdx0A
	 Q6AAmBrXVhGub461gBzQGwTJhUUB++7Th3gsFJCi4oDf+aWLjF7WF6GdggaVHmkbRS
	 kFgeYk0OIm4rZmEsWIPuFQsnVehRlAlzcYYK36cp4DgZHiHntNS3WeD8QeBXz34QXc
	 IfasqzSuT1aEDDKYSNJS7CkQpejGBSTvyTBBJL2wbtZP5RwoZna73gJ2v8f3xyY+PW
	 Q0VCYKbCLCFpQ==
X-Cc: netdev@vger.kernel.org, quic@lists.linux.dev, davem@davemloft.net,
 kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org,
 metze@samba.org, mbuhl@openbsd.org, tfanelli@redhat.com, hepengtao@xiaomi.com,
 dreibh@simula.no, jamie.bainbridge@gmail.com, linux-cifs@vger.kernel.org,
 pc@manguebit.org, linkinjeon@kernel.org, tom@talpey.com,
 kernel-tls-handshake@lists.linux.dev, cel@kernel.org, jlayton@kernel.org,
 steved@redhat.com, hare@suse.de, aahringo@redhat.com, dhowells@redhat.com,
 matttbe@kernel.org, mail@johnericson.me, xiyou.wangcong@gmail.com,
 alibuda@linux.alibaba.com, jbaron@akamai.com, illiliti@protonmail.com,
 sd@queasysnail.net, marcelo.leitner@gmail.com, daniel@haxx.se,
 andrew.gospodarek@broadcom.com, mef@scarletmail.rutgers.edu, paul@jakma.org,
 kuniyu@google.com
X-In-Reply-To: <5c305e22057f748d5c4d4cbc94a1e14271dbc485.1795393691.git.lucien.xin@gmail.com>
X-sashiko-severity: Medium
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