Netdev List
 help / color / mirror / Atom feed
From: Andrea Mayer <andrea.mayer@uniroma2.it>
To: netdev-bot+sashiko@kernel.org
Cc: davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, dsahern@kernel.org, horms@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org, shuah@kernel.org,
	hangbin.liu@linux.dev, justin.iurman@gmail.com,
	nicolas.dichtel@6wind.com, ahabdels@cisco.com,
	stefano.salsano@uniroma2.it, andrea@common-net.org,
	Andrea Mayer <andrea.mayer@uniroma2.it>
Subject: Re: [PATCH net-next 5/5] selftests: seg6: add tests for PSP with a consumed SRH
Date: Thu, 15 Oct 2026 03:45:41 +0200	[thread overview]
Message-ID: <20261015034541.cc16ac6eb2dfdb2f9273a021@uniroma2.it> (raw)
In-Reply-To: <179183319121.434549.16235006579764445540@kernel.org>

On Mon, 12 Oct 2026 19:26:31 +0000
netdev-bot+sashiko@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 · High: 0 · Medium: 1 · Low: 1
>
> 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] The consumed-SRH tests in
>   host_srv6_end_flv_consumed_srh_tests()…
> - [Low] setup_rt_consumed_srh() runs `ip -netns ... -6 route add "${sid}"
>   table 90 encap seg6 mode inline segs ... dev dum0` and does not check…
>
> --
>
> [snip]
>
> [Severity: Medium]
> If rt-2 removes the wrong SRH, or no SRH at all, would these tests notice?
>
> [snip]
>
> So two possible kernel regressions on the multi-SRH path would still pass:
>
>   - end_flv8986_core() takes srhoff from the first routing header instead of
>     the one found with IP6_FH_F_SKIP_RH. seg6_pop_srh() then removes the
>     consumed SRH at offset 40 and leaves
>     "IPv6 | Policy's SRH, SL=0 | ICMPv6".
>
>   - PSP falls back to plain End without calling seg6_pop_srh(), which leaves
>     "IPv6 | extra SRH, SL=0 | Policy's SRH, SL=0 | ICMPv6".
>
> In both cases ipv6_srh_rcv() skips each SL=0 SRH, the echo request is
> delivered, and the ping succeeds.
>
> The comment and the commit message say "PSP itself is checked by the PSP
> flavor and NEXT-C-SID,PSP tests". Those tests only carry a single SRH, so
> srhoff is always sizeof(struct ipv6hdr). They never pick an SRH at
> srhoff > 40, and they never run the positional nexthdr fix-up in the else
> branch of seg6_pop_srh():
>
> 	if (srhoff == sizeof(*iph)) {
> 		iph->nexthdr = srh_nexthdr;
> 	} else {
> 		...
>
> Could a host-side check of what is left in the packet close this gap? One
> option is an ip6tables "-m srh" match on the host's veth0. It would accept
> only a first SRH with --srh-last-entry-eq 1 and --srh-next-hdr 58.
>
> [snip]

The consumed-SRH tests in this patch would not notice these cases.

However, the suggested match is not enough for the first case. In (i.b)
and (i.d), the Policy's SRH also has Last Entry 1 and is followed by
ICMPv6, and the packet is still accepted. I checked this on a kernel
where I added this regression on purpose.

A check on Segment List[0] of the first SRH would detect this case. In
the extra SRH it is the SID that triggered the insertion, while in the
Policy's SRH it is an address of the host.

I will address this finding in v2.

> [snip]
>
> > +setup_rt_consumed_srh()
> > +{
> > +	local rt="$1"
> > +	local sid="$2"
> > +	local end_rt="$3"
> > +	local nsname
> > +
> > +	nsname="$(get_rtname "${rt}")"
> > +
> > +	ip -netns "${nsname}" -6 route \
> > +		add "${sid}" table "${LOCALSID_TABLE_ID}" \
> > +		encap seg6 mode inline \
> > +		segs "${LOCATOR_SERVICE}:${end_rt}::${END_FUNC}" \
> > +		dev "${DUMMY_DEVNAME}"
> > +}
>
> [Severity: Low]
> Should setup_rt_consumed_srh() check the exit status of this ip route add?
>
> The test body runs with set +e, so a failure here is ignored. Without the
> route, the extra SRH is never inserted.
>
> The packet would then follow the plain Policy path that the earlier PSP and
> NEXT-C-SID tests already cover. The ping would succeed, since the hosts have
> seg6_enabled=1. log_test would then record a pass for the consumed SRH case
> without running that path.
>
> I could not find a way for this route add to fail in the current topology.
> setup() already uses the same features under set -e, so this is a
> robustness question more than a confirmed failure.
>
> [snip]

I will also have a look at this for v2.

Ciao,
Andrea

pw-bot: cr

      reply	other threads:[~2026-10-15  1:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 19:23 [PATCH net-next 0/5] seg6: fixes for the PSP flavor of SRv6 End Andrea Mayer
2026-10-11 19:23 ` [PATCH net-next 1/5] seg6: handle a Fragment or AH header before the SRH consistently in PSP Andrea Mayer
2026-10-12  7:59   ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 2/5] seg6: handle a consumed SRH in SRv6 End with the PSP flavor Andrea Mayer
2026-10-12  9:28   ` Hangbin Liu
2026-10-12 21:40     ` Andrea Mayer
2026-10-13  0:29       ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 3/5] seg6: apply the PSP flavor together with NEXT-C-SID in SRv6 End Andrea Mayer
2026-10-12  8:17   ` Hangbin Liu
2026-10-14 22:00     ` Andrea Mayer
2026-10-15  0:54       ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 4/5] selftests: seg6: add tests for PSP together with NEXT-C-SID Andrea Mayer
2026-10-12  7:54   ` Hangbin Liu
2026-10-11 19:23 ` [PATCH net-next 5/5] selftests: seg6: add tests for PSP with a consumed SRH Andrea Mayer
2026-10-12  8:19   ` Hangbin Liu
2026-10-12 19:26   ` netdev-bot+sashiko
2026-10-15  1:45     ` Andrea Mayer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261015034541.cc16ac6eb2dfdb2f9273a021@uniroma2.it \
    --to=andrea.mayer@uniroma2.it \
    --cc=ahabdels@cisco.com \
    --cc=andrea@common-net.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hangbin.liu@linux.dev \
    --cc=horms@kernel.org \
    --cc=justin.iurman@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=stefano.salsano@uniroma2.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox