Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: alice.kernel@fastmail.im
Cc: willemdebruijn.kernel@gmail.com, dsahern@kernel.org,
	idosch@nvidia.com, kuba@kernel.org, pabeni@redhat.com,
	davem@davemloft.net, edumazet@google.com, horms@kernel.org,
	shuah@kernel.org, hannes@stressinduktion.org,
	vadim.fedorenko@linux.dev, netdev@vger.kernel.org,
	alice@isovalent.com, willemb@google.com
Subject: Re: [PATCH net v5 2/4] net: ipv6: Fix UDP length overflow with PMTU discover and big MTU
Date: Fri, 04 Sep 2026 10:57:39 +0000	[thread overview]
Message-ID: <178851945904.4131868.3334753415934417691@kernel.org> (raw)
In-Reply-To: <20260901195714.673548-3-alice.kernel@fastmail.im>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

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

- [Low] Claim that the commit message's "Steps to reproduce (included in
  the new selftest)" references a selftest that does not exist in this…

--

net: ipv6: Fix UDP length overflow with PMTU discover and big MTU

The change clamps cork->base.fragsize to IP6_MAX_MTU in ip6_setup_cork() for
UDP sockets, so a device MTU larger than IP6_MAX_MTU combined with
IPV6_PMTUDISC_DO or IPV6_PMTUDISC_PROBE can no longer produce a 16-bit UDP
length overflow. Raw IPv6 sockets are left alone so jumbograms keep working.

Link: https://lore.kernel.org/netdev/6a6a966c.86abc875.e5c3d.0054.GAE@google.com/

> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 8fc4766c8da90..5509650589915 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1432,6 +1432,8 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
>  	if (frag_size && frag_size < mtu)
>  		mtu = frag_size;
>  
> +	if (sk_is_udp(sk))
> +		mtu = min(mtu, IP6_MAX_MTU);
>  	cork->base.fragsize = mtu;
>  	cork->base.gso_size = ipc6->gso_size;
>  	cork->base.tx_flags = 0;

One note on the changelog rather than the code:

> Steps to reproduce (included in the new selftest):

[Severity: Low]
This turned out to be accurate, so no change is needed here; noting it only
because the reference is forward-looking within the series.

This commit only touches net/ipv6/ip6_output.c, so "the new selftest" is not
present in this commit itself.  The test is added by the later patch in the
same series, "selftests: net: Test UDP length overflow with PMTU discover and
big MTU", which creates tools/testing/selftests/net/cork_fragsize.py and adds
it to TEST_PROGS in tools/testing/selftests/net/Makefile:

  +	cork_fragsize.py \

The ipv6 variant of test_udp() there does set up a dummy netdev with an MTU
above IP6_MAX_MTU, sets IPV6_MTU_DISCOVER to IPV6_PMTUDISC_DO, sends 65528
bytes and expects EMSGSIZE, and test_ipv6_jumbo() covers the raw socket
jumbogram case mentioned in the last paragraph of the changelog.

Would it be worth saying "included in a selftest added later in this series"
so that anyone reading or backporting this commit alone knows where to look?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260901195714.673548-1-alice.kernel%40fastmail.im

  reply	other threads:[~2026-09-04 10:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 19:57 [PATCH net v5 0/4] Fix UDP length overflow in edge cases Alice Mikityanska
2026-09-01 19:57 ` [PATCH net v5 1/4] net: ipv4: Fix UDP length overflow with PMTU discover and big MTU Alice Mikityanska
2026-09-01 19:57 ` [PATCH net v5 2/4] net: ipv6: " Alice Mikityanska
2026-09-04 10:57   ` netdev-bot+sashiko [this message]
2026-09-01 19:57 ` [PATCH net v5 3/4] selftests: net: Test " Alice Mikityanska
2026-09-04 10:57   ` netdev-bot+sashiko
2026-09-01 19:57 ` [PATCH net v5 4/4] net: ipv6: Clamp to IP6_MAX_MTU in ip6_dst_mtu_maybe_forward Alice Mikityanska
2026-09-04 10:57   ` netdev-bot+sashiko

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=178851945904.4131868.3334753415934417691@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=alice.kernel@fastmail.im \
    --cc=alice@isovalent.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=hannes@stressinduktion.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /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