Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by netdev-bot+sashiko
Wed, 04 Nov 2026 00:44
Re: [PATCH net v4 6/7] selftests: drv-net: psp: test that ipv4 psp packets aren't fragmented
Author: netdev-bot+sashiko
Date: Wed, 04 Nov 2026 00:44
Date: Wed, 04 Nov 2026 00:44
95 lines
11603 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads