🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10722

Re: [PATCH net v4 6/7] selftests: drv-net: psp: test that ipv4 psp packets aren't fragmented

#10722
From: netdev-bot+sashiko
Date: Wed, 04 Nov 2026 00:44
95 lines
11603 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] In data_send_ipv4_frags()
  (tools/testing/selftests/drivers/net/psp.py), the remote leak detector…

--

selftests: drv-net: psp: test that ipv4 psp packets aren't fragmented

This adds data_send_ipv4_frags() to the PSP selftest. It raises the route
MTU on both ends above the device MTU and sets IP_PMTUDISC_OMIT on a PSP
socket, so that its IPv4 packets would need fragmenting. It then checks
that no fragments reach the peer and that IpFragFails increases.

> diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
> index c9a725cc89a27..f6888f93cb937 100755
> --- a/tools/testing/selftests/drivers/net/psp.py
> +++ b/tools/testing/selftests/drivers/net/psp.py

[ ... ]

> +def data_send_ipv4_frags(cfg):
> +    """ Test that IPv4 packets of a PSP TCP socket aren't fragmented """
> +    cfg.require_ipver("4")
> +    _init_psp_dev(cfg)
> +
> +    # Fragments which get out reach the remote. Set up the count before
> +    # connecting, so a skip doesn't leave the responder mid key exchange.
> +    loc, rem = cfg.addr_v["4"], cfg.remote_addr_v["4"]
> +    remote_frags = _remote_count(cfg, "ip",
> +                                 f"src_ip {loc} dst_ip {rem} ip_flags frag")

[Severity: Medium]
Is loc guaranteed to be the source address the PSP socket actually uses?

loc is LOCAL_V4 from the environment. NetDrvEpEnv only checks that it is
set. It does not check that it is the address the kernel prefers toward
REMOTE_V4.

The socket is not bound to loc either. _make_psp_conn() does:

    s = socket.create_connection((remote_addr, cfg.comm_port), )

The local /32 route that _ipv4_route_mtu(rem, mtu) adds pins the source to
whatever "ip route get" returned:

    ip(f"route add {dst}/32 dev {route['dev']} src {route['prefsrc']} "
       f"mtu {mtu}", host=host)

So the socket's source is route['prefsrc'], and nothing compares it with
loc. Using a secondary address on NETIF as LOCAL_V4 would be enough to make
the two differ.

When they differ, the remote route added by
_ipv4_route_mtu(loc, mtu, host=cfg.remote) does not apply to this
connection. With equal device MTUs, the peer's MSS clamps ours. The test
then skips with "mss N needs no fragmenting" and never exercises the path.

If the remote device MTU is larger, the test does run. Without the fix in
"net: don't fragment decrypted skbs", though, the cleartext fragments carry
src=prefsrc. The flower filter would not match them, so this check passes
trivially:

    ksft_eq(remote_frags(), 0, comment="fragments reached the remote")

Only the netns-wide FragFails delta is left, and the test's own comment
says that one only confirms the drop. Any unrelated FragFails increment
during the 3 second send window would then make the test pass falsely.

data_send_ipv6_exthdr() avoids this by building its filter from
_src_addr(peer). Could this test do the same? Some options:

  - use route['prefsrc'] (or s.getsockname()[0]) for both the filter and
    the remote route
  - bind the socket to loc
  - skip when loc and the chosen source differ

A related, smaller point: the skip check compares mss against
cfg.dev['mtu'], but fragmentation uses the MTU of route['dev']. Nothing
checks that route['dev'] is cfg.ifname. Should that be checked as well?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261103001143.246081-1-toddfreed%40meta.com
Technical Details
Message-ID: <179375308755.488856.948082964372253216@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356102-linux-kernel-netdev=dewy.ru
References: <20261103001143.246081-7-toddfreed@meta.com>

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-356102-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v4 6/7] selftests: drv-net: psp: test that ipv4 psp
 packets aren't fragmented
Date: Wed, 04 Nov 2026 00:44:47 +0000
Organization: Usenet Network
Message-ID: <179375308755.488856.948082964372253216@kernel.org>
References: <20261103001143.246081-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="3295624"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:6SJdMC47WexiQx74IPNr7i/eIC4= sha256:apWLXX15sV8P+Jv3G9vA5U/CryYWwNVqG8YJwtK/e6s=
	sha1:KjVb/x8E2uhnv91999OtSeUD0w0= sha256:CmXH9OQQNjrm4jZ8jqTFVJBCPgGMe9QH0MInF2PnMCg=
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 9A3CA112A90; Wed,  4 Nov 2026 03:45:26 +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 CIg9sheafyAX;
	Wed,  4 Nov 2026 03:45:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-356102-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 32ED5112A8E; Wed,  4 Nov 2026 03:45:14 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 3FE7D23E93; Wed,  4 Nov 2026 00:44:54 +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=1793753091;
	b=4wrlYc2ZKWf+JJXo/B5Ebsf7Y38seDwyp5bnXo917gyBzEe+AK41ljNVGgm0pVQEwTGa
	 AKmRYKcapgFofz5ECisu+F4lPbtrtHWyZWj96tXvVdhPBYE1EVefBRnj9Y4GVv93IYmPB
	 y9zPwIw+b76n9ShJZAOoA0Ld8lWc2CTA0vT0KzNMncnqptD6KRaEUj0gYNkad1jqe+aJP
	 iQ4sRH6haMby2nClpmiLVmWot9TrzVBbXf9Npe2J6U3zdV5RDJXEal50/aJYqBZEv/ING
	 GgdFyMeOCaV8whd2Wv4d3OFJuvinwmZw0tOIM30bAbzbFvZoCgN4gPwkfG1VDPYIjbg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793753091;
	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=c35T3kU6/qhinEdzbeAC7pzjMrrfVOHaMqt5ai5YUPI=;
	b=PpMvA0Y1T+MB4NNc0CX3bNLlaBlahHo8mwnKYN3VJKO9alXW61lf1qmyJF7Kseqdc2fo
	 4G7jjfsqAt34fPRzSwzEO8w4vm+2VVI51j0/Cu0TKfcd5V4XJ0EgpmP1LdoCmmU+7VY6f
	 KqeuO3tmb2sAEBogjwBghNHUj4KHdqryYNwZhRLgVDbAOBfetvW/RroI3d9PnUcK/sXsO
	 crJA40ytAYtvw0cf11eqWb0pRb3bCSM8hHOc36CAlbZhpRJcHsrO+Ze6xXzyYwW8SUfdq
	 cC8qRH+LrUel4DBtQkuxkm6APjAf8GR0rCrpYs3ClcDjs79xbluq5O5G6uLErYfGwjA==
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=CvUeAFcH;
	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 28AE2606D80D;
	Wed,  4 Nov 2026 00:44:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CvUeAFcH
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=1793753088;
	b=UP5/kgwWgLVtR5A/RGRwiKYrOUyfsLo9H30mml8e0tXG16KDMsU69BIPDm2/qgnHW/PS
	 SyrZSOvfqhol6Ag2Ha1GslMv0xTXUDF/4XjBm5iaPBmr8raTZQeb0zM5/ukcjxcof+W8a
	 Ij+d/aCtJhGnOEBD3knDH2skVcCGl8f2AcE5s6W0+p8Vrpav2/0dYkbm76zRs3SbheWVs
	 kBWoMXFrxty7VJ0zt46FHsboju1b5uCmXJW2SAzkPSomF1hN69riPvXNIz6TcKCi8IbO3
	 bZjsi/cVQhrE8nlcfh7TiAWLf5EhX3znvEX8q7E9JCLVk04q+JbxbY5Nl7Axo6U1i6A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793753088;
	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=c35T3kU6/qhinEdzbeAC7pzjMrrfVOHaMqt5ai5YUPI=;
	b=wEhZPrgXElbNAZYkdhNGLkU9/UcCcEHnGCCnPRm6L9tDjESUyTQGjvNAz12uSWx6bxF2
	 A8lHbxV+TUq9S8DKyu05MnglYvoklohh94054L3/DiuPFBFCIPnOtBCNQxFHZqRQ2JlOz
	 HJTwKkichK+4ZPb+wSRGPaVThA7E1CaZDmi6hXiYftRy0RsW/FS/Frftv6KDRhIM06HZh
	 MjZTtre3sJh1A0CyPzxeKauhPFAuEL45CtoPKmJoGrwFUuZlEr4XQkKdmgsN8X2nbROrt
	 By5U6h5q7eyskcRIGpjnL+IBBlD2fpLNX4mPGaPR5Ccp53PPLzJULza2jIXPsuIugwQ==
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=CvUeAFcH;
	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 65DE6606A338;
	Wed,  4 Nov 2026 00:44:48 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED9A51F00A16;
	Wed,  4 Nov 2026 00:44:47 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793753088;
	bh=c35T3kU6/qhinEdzbeAC7pzjMrrfVOHaMqt5ai5YUPI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=CvUeAFcHHcVCUq6HZBEHdgEg/1GmpEdfRPTVzmnEMjGtVaS5PQ5RuzE+vrA0h8FZO
	 FB5cJSkUfold601UkR450pZDG/bt3KHVo7DgoSeCfmqj+uUA58ZbOV4T73Ut7f+DNu
	 bAPLI+G/MOayXAzR2P4UY/2aRj7DUWyyc99JLNAhFDYCr86CyF2MJFdnENxHLvpPuA
	 T3kc+iSIZT9CXgiS5geV+83eYQgS8a1jZcwZ2NchqquZTo2fg+gXq+hpe3DN9ZzUlh
	 RgS5m7nlonSmqabPRFCpOrJwF6OhZiznCxj71UyJ/qciPQNeOrMKrKH0xUhl2n35hQ
	 Y7S/kL3U7giAw==
X-Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
 sashiko-bot@kernel.org, kuba@kernel.org, bjorn@kernel.org
X-In-Reply-To: <20261103001143.246081-7-toddfreed@meta.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