Article View: linux.kernel.netdev
Article #16554Re: [PATCH net v5 6/8] selftests: drv-net: psp: test ipv6 tcp socket with extension headers
From: netdev-bot+sashiko
Date: Sun, 15 Nov 2026 07:21
Date: Sun, 15 Nov 2026 07:21
91 lines
11563 bytes
11563 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In data_send_ipv6_exthdr()
(tools/testing/selftests/drivers/net/psp.py), the finally block runs…
- [Low] Concern: the commit message overstates coverage ('a variant for
each extension header a socket can set') because there is no…
--
selftests: drv-net: psp: test ipv6 tcp socket with extension headers
This adds a PSP selftest that sends data on an IPv6 PSP TCP socket in
three phases: with no extension header, with one set (IPV6_DSTOPTS,
IPV6_HOPOPTS or IPV6_RTHDR), and after the option is removed. After each
phase it checks the device's tx-packets and a tc flower UDP counter on
the remote. It also adds a helper that waits for stats to quiesce, and
adds CONFIG_NET_ACT_GACT to the config.
> diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
> index 473500901879b..7e251439a2fd9 100755
> --- a/tools/testing/selftests/drivers/net/psp.py
> +++ b/tools/testing/selftests/drivers/net/psp.py
[ ... ]
> @@ -658,6 +710,95 @@ def removal_device_bi(cfg):
[ ... ]
> +@ksft_variants(_ipv6_exthdr_variants())
> +def data_send_ipv6_exthdr(cfg, opt, val):
> + """ Test that PSP drops IPv6 packets with an extension header """
[ ... ]
> + # 2. With the option: dropped, not counted, and nothing reaches the
> + # peer. The data stays queued.
> + s.setsockopt(socket.IPPROTO_IPV6, opt, val(peer))
[ ... ]
> + finally:
> + # With the option, the queued data, the FIN and the ACKs would be
> + # dropped, leaving an orphan holding the association
> + s.setsockopt(socket.IPPROTO_IPV6, opt, b'')
> + _close_psp_conn(cfg, s)
[Severity: Low]
What happens to this cleanup in data_send_ipv6_exthdr() when the test
runs without CAP_NET_RAW, for the dstopts and hopopts variants?
ipv6_set_opt_hdr() checks the capability before it reaches the
zero-length removal path. That means clearing the option with b'' can
also fail with EPERM:
net/ipv6/ipv6_sockglue.c:ipv6_set_opt_hdr() {
...
/* hop-by-hop / destination options are privileged option */
if (optname != IPV6_RTHDR && !sockopt_ns_capable(net->user_ns, CAP_NET_RAW))
return -EPERM;
/* remove any sticky options header with a zero option
* length, per RFC3542.
*/
if (optlen > 0) {
...
}
In that case the phase 2 setsockopt raises PermissionError first. Then
the setsockopt in the finally block raises a second PermissionError, so
_close_psp_conn() never runs.
When that happens, psp_responder never gets the "data close" command and
keeps its data socket open. The local PSP socket isn't closed explicitly
either, and the original exception ends up chained under the second one.
The following test cases share cfg.comm_sock and the responder state, so
they could be affected.
The rthdr variant isn't affected because IPV6_RTHDR skips the capability
check.
Could the option removal be guarded separately, for example with a
nested try/finally, so that _close_psp_conn() always runs?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261111001831.3710881-1-toddfreed%40meta.com
Technical Details
Message-ID:
<179472727541.2199510.15003590884466629301@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363585-linux-kernel-netdev=dewy.ruReferences:
<20261111001831.3710881-7-toddfreed@meta.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363585-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v5 6/8] selftests: drv-net: psp: test ipv6 tcp socket with extension headers Date: Sun, 15 Nov 2026 07:21:15 +0000 Organization: Usenet Network Message-ID: <179472727541.2199510.15003590884466629301@kernel.org> References: <20261111001831.3710881-7-toddfreed@meta.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1746758"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:/2K5JbBHBxBSfZqmQl13ZH9pN1Y= sha256:qlWXAwkPZxzq07P3YFWTvSApJRd9tHwqjXN/gq3ZKLg= sha1:nuUfGxHMpHvIdhcsD4emFqSiEYk= sha256:T9V60TIrw6JH35hZmC/n054iiFhhs6K231r7Ehg2U/o= 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 69729114955; Sun, 15 Nov 2026 10:21:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[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] 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 lMXwM1b1KKMQ; Sun, 15 Nov 2026 10:21:41 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363585-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 4D7F1114953; Sun, 15 Nov 2026 10:21:30 +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 378B33BA34; Sun, 15 Nov 2026 07:21:24 +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=1794727278; b=lXejKByQ+cwcscpVjIlpThizCmsJ7FLZ9A1Urm6Gd/nJX1qUWJIfwpDF7OAT6Ex/A8FV hS48YJyOr3RvZNoQg0sDUsHtciwbtHgDNincawsby/RA57QDkjI7D4CJCWzMvoWvWg2p+ b10JTUlTqGmDy6zqI4kJ9tMRGD/gRaCgyv62euB9djyHsc3Mk9nVnVi2cfflc+qvoikeI jzPuWITwJwp356AkAy4kXdXGeW7+4ZVlXk1vLTu/IQoSvw4fwm2BSo14AjqZsxSqKo9S7 BQnlVkvqXB6twtF/FyxwGQpJT86tkSdjGAGhkKmdkj7xg/4+zeTvqIDEeZKn7vW4MWw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794727278; 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=1wIaAoqveAUksE+imNE0AFXmAQw+PL+pfe8nYBhWq84=; b=cAzxkA8QKB5ZnebVNJWh0Um75QlQX83WODIiGft6PSM1Ckq7gi4ip8yCwJXj/7T6mJfo WV5gtr+wpjYihP2RPasDf/DaNLsu1F+6E/qZDehuQ0qjZzQ3lxSygW3eMZYYfKR2G07Mt zN/tU/IIzq2CTGkviQCl8qbr3kJSFuSEtqiZKafc+RULy4K2EtDKtYlgPStxz9vBxvsXB xloau/hrDJMmA1x/B4DeJgKXG7dKSyBvXhK+WshCrLIsuLQQpsqLQxQS2HhzkFbmxda8g jvXGv1GpPNhZk8I36nyj+Jm7kHPO7Pk3XWXx3HZM1V7eA+QdPUhrEPblcpWOj9A7Ksw== 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=lWSx1ymw; 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 86CD7606A899; Sun, 15 Nov 2026 07:21:18 +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=lWSx1ymw 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=1794727277; b=FVgB9SyWXFtultqspuCED0s+VSIk27HP+ivEgHM1XpUXkBKk0eq7Tx+UsBanq29cP5wm kyppAe2K2pn34dYAFkJ3rOBhszGxkIacHRYEosExdZzRFYjOCd9Tnlr86adnOnjKbUo84 zbLoERQprrw/gc11RKrL8SKpJW2RYalF4jkgDoEGBnqvAO6tKFKjEi6cBp9vqEXxHaqOK YLIUqMaVKo1zRS40+gMQhrcGFRkKOQYf6Qt0Dj8fVvB1tXS9lI2hB9uUFZyzprN2EbzWT BqLbp71Z7PCZm3kQe/06V7PKSs8jKPoKgD0mcMg+4OyIcceOXjiQKmi4G4WhqH+rn6w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794727277; 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=1wIaAoqveAUksE+imNE0AFXmAQw+PL+pfe8nYBhWq84=; b=sON8D346ChDCHa9cV0JJAj2UELdGU+8SxweVVY1XnNAGhs2eMXcSpo1iDzHmKQPoRwt4 t0UwGFYOQs4OFIOtf2c1/Uwmg0xaabix/nUst1aGV4mf6YDSBrvORmuWZ5jsnFSDPf5FD RCaPFb01N3aFA0uc8eOgrNfXx6YpCZkQGYRr/YkjjAh4YMiM5b7sy0isZQfckTLlB5k/f KNgt9ei8BIYkTofSzN3VoR/ZhxhZCaKHLARaAMpgtn7QdWccwjQ/v/AZnW5yjpOQpz5KY 1ZiH6G6B4b0T5MiSvxOaPHA2ZpuhS+17s11W594/c7ah3gWV0B2sea0RlPmvIUdX8tw== 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=lWSx1ymw; 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 A6CE8606A884; Sun, 15 Nov 2026 07:21:17 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CADDD1F000C4; Sun, 15 Nov 2026 07:21:15 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794727277; bh=1wIaAoqveAUksE+imNE0AFXmAQw+PL+pfe8nYBhWq84=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=lWSx1ymwqRfPvPk1GLXLzUv7x3SCPAxEYESanV567uUw+AKA7q8979FM4nIo5zA3N Tf/4Jy8c7fwHIVvYdzppVxuol+fjZKIUz7vBXFR+h/eKPM/Yx+V1Mo0wYZ6Rq4OQI9 cQ96d1Xk3cjOaZbjoY/T7bkCBDlgGRloIoCCKvWXpupUsfUXm8BVrFWMOR9/ABbiu/ onHdby1te+yFR3QzWs7DEDzmcpQbbRzEFAUzDOQaGYXqm4CpP5bavHYQC/1IJglldP yQYrDwOmcIDAdh8TZy6I8TnYgGbKVgWHIJB+9T1NX9/fWb669T9P0lOT2b0F/jRZR9 EB2x/JjGGZb3g== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, andrew+netdev@lunn.ch, bjorn@kernel.org, borisp@nvidia.com, cratiu@nvidia.com, daniel.zahka@gmail.com, dsahern@kernel.org, dtatulea@nvidia.com, edumazet@kernel.org, idosch@nvidia.com, kuba@kernel.org, john.fastabend@gmail.com, leon@kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, pabeni@redhat.com, raeds@nvidia.com, rrameshbabu@nvidia.com, sd@queasysnail.net, saeedm@nvidia.com, shuah@kernel.org, horms@kernel.org, tariqt@nvidia.com, weiwan@google.com, willemdebruijn.kernel@gmail.com X-In-Reply-To: <20261111001831.3710881-7-toddfreed@meta.com> X-sashiko-severity: Low 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