Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: zhangmh25@mails.tsinghua.edu.cn
Cc: netdev@vger.kernel.org, dsahern@kernel.org, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, pshelar@nicira.com, stable@vger.kernel.org,
	jianjun@tsinghua.edu.cn
Subject: Re: [PATCH net] net: ipv4: fix tnl_update_pmtu negative MTU advertisement
Date: Tue, 3 Nov 2026 17:18:44 +0200	[thread overview]
Message-ID: <20261103151844.GA1234870@shredder> (raw)
In-Reply-To: <20261102155444.2658518-1-zhangmh25@mails.tsinghua.edu.cn>

On Mon, Nov 02, 2026 at 11:54:44PM +0800, zhangmh25@mails.tsinghua.edu.cn wrote:
> From: Minghao Zhang <zhangmh25@mails.tsinghua.edu.cn>
> 
> tnl_update_pmtu() derives the tunnel MTU for DF packets by subtracting
> the outer IP header and the tunnel header length from the MTU of the
> underlay route.  When that route has a very low MTU (for example one
> installed with "ip route ... mtu 15" on an ipip tunnel, where the
> outer header alone is 20 bytes), the result can drop below
> IPV4_MIN_MTU or even become negative.
> 
> The IPv6 branch of the same function emits ICMPV6_PKT_TOOBIG only
> when mtu >= IPV6_MIN_MTU, but the IPv4 branch passes the unclamped
> value to icmp_ndo_send().  An effective MTU of -5 produces a bogus
> Next-Hop MTU value of 65531 in the generated ICMP_FRAG_NEEDED instead
> of providing usable PMTU feedback.  Values below IPV4_MIN_MTU are not
> valid to advertise (RFC 1191), and ip_tunnel_bind_dev() already
> clamps the device MTU to IPV4_MIN_MTU.
> 
> Mirror the IPv6 guard and only send the error when mtu >=
> IPV4_MIN_MTU.  The packet is still rejected with -E2BIG.
> 
> IPIP previously rejected packets when the effective tunnel MTU was
> below 68.  Commit fd58156e456d ("IPIP: Use ip-tunneling code.")
> switched IPIP to the shared transmit path, which lacked this check.
> 
> Tested in a network namespace with an ipip tunnel: with a tunnel route
> of "mtu 15" the kernel generates an ICMP_FRAG_NEEDED advertising a
> next-hop MTU of 65531, and with a route of "mtu 88" it advertises the
> correct MTU of 68.  After this change no ICMP error is generated for
> the "mtu 15" case while the packet is still rejected with -E2BIG, and
> the "mtu 88" advertisement is unchanged.
> 
> Found during a systematic audit of PMTU handling in tunnel
> encapsulation paths.
> 
> Fixes: fd58156e456d ("IPIP: Use ip-tunneling code.")
> Reported-by: Minghao Zhang <zhangmh25@mails.tsinghua.edu.cn>
> Reported-by: Jianjun Chen <jianjun@tsinghua.edu.cn>
> Cc: stable@vger.kernel.org
> Signed-off-by: Minghao Zhang <zhangmh25@mails.tsinghua.edu.cn>
> ---
>  net/ipv4/ip_tunnel.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Why is this interesting?

An admin setting such a low MTU turns the box into a blackhole. Why does
it matter if a bogus MTU is advertised in the ICMP error? The overlay
source will see that it's bigger than the current MTU and won't update
its PMTU. At best this seems like net-next material, but even then it
seems like unnecessary churn.

      reply	other threads:[~2026-11-03 15:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 15:54 [PATCH net] net: ipv4: fix tnl_update_pmtu negative MTU advertisement zhangmh25
2026-11-03 15:18 ` Ido Schimmel [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=20261103151844.GA1234870@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jianjun@tsinghua.edu.cn \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@nicira.com \
    --cc=stable@vger.kernel.org \
    --cc=zhangmh25@mails.tsinghua.edu.cn \
    /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