* Re: [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD
2026-09-02 19:01 [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD Ido Schimmel
@ 2026-09-02 19:50 ` Yaroslav Dudkov
2026-09-02 20:23 ` David Ahern
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Yaroslav Dudkov @ 2026-09-02 19:50 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev, davem, kuba, pabeni, edumazet, dsahern, horms, aconole,
sbrivio, gnault, laikabcprice, rough.rock3059, stable,
Yaroslav Dudkov
On Wed, Sep 02, 2026 at 07:01:12PM +0000, Ido Schimmel wrote:
> Fix this by making sure that the ICMP error packet does not have a valid
> dst entry, thereby forcing the IP layer to perform a route lookup.
Tested on net with this patch applied:
- pmtu.sh: all 16 bridged and all 16 OVS subtests pass, both with and
without br_netfilter loaded. Without the patch, loading br_netfilter
makes all 16 bridged subtests fail (the reply gets delivered and exits
with the old -w 1 failure).
- The forwarded-sender reproducer from my earlier mail goes from
10 tx / 0 rx / no errors to 10 tx / 8 rx / +1 error, the error being
"From 192.168.4.1 icmp_seq=1 Frag needed and DF set (mtu = 3950)" --
the tunnel's PTB reaching the sender.
Tested-by: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD
2026-09-02 19:01 [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD Ido Schimmel
2026-09-02 19:50 ` Yaroslav Dudkov
@ 2026-09-02 20:23 ` David Ahern
2026-09-03 7:55 ` Stefano Brivio
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: David Ahern @ 2026-09-02 20:23 UTC (permalink / raw)
To: Ido Schimmel, netdev
Cc: davem, kuba, pabeni, edumazet, horms, aconole, sbrivio, gnault,
laikabcprice, aroslavdudkov622, rough.rock3059, stable
On 9/2/26 1:01 PM, Ido Schimmel wrote:
> Bridged UDP tunnels such as VXLAN and GENEVE build an ICMP error packet
> around an overlay packet if the packet is going to exceed the underlay
> path MTU. The ICMP error packet is then injected back into the Rx path
> with the source and destination addresses swapped, so that it will be
> delivered to the overlay source.
>
> If the overlay packet was routed to the UDP tunnel or locally generated,
> then it is already carrying a valid dst entry and this entry is not
> dropped when transforming the packet to an ICMP error packet. This
> causes the IP layer to reuse the dst entry, leading to the ICMP error
> packet being dropped or routed out of the UDP tunnel interface in case
> of forwarding.
>
> Prior to the blamed commit this could not happen, as
> skb_tunnel_check_pmtu() did not build ICMP errors for PACKET_HOST
> packets. Such packets were instead encapsulated and, unless the DF bit
> was set in the outer header, fragmented by the underlay.
>
> Fix this by making sure that the ICMP error packet does not have a valid
> dst entry, thereby forcing the IP layer to perform a route lookup.
>
> Adjust the bridged PMTU exception selftests accordingly. When the
> local sender in ns_a pings the overlay destination with a deadline
> (-w), ping exits on the first socket error before any reply is
> received and returns a non-zero exit code. The test therefore only
> passed because the ICMP error was never delivered. Use a packet count
> (-c) like the ns_c line above it, so that the ICMP error counts
> against the packet budget and the exit code depends on whether echo
> replies were received. This passes with and without the fix.
>
> Fixes: 8930424777e4 ("tunnels: Accept PACKET_HOST in skb_tunnel_check_pmtu().")
> Cc: stable@vger.kernel.org
> Reported-by: Laika Price <laikabcprice@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260614-master-v3-1-9f5060ba1ed1@gmail.com/
> Reported-by: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260901081825.287173-1-aroslavdudkov622@gmail.com/
> Reported-by: Charles Bordet <rough.rock3059@datachamp.fr>
> Closes: https://lore.kernel.org/netdev/aHVhQLPJIhq-SYPM@eldamar.lan/
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
> net/ipv4/ip_tunnel_core.c | 6 ++++++
> tools/testing/selftests/net/pmtu.sh | 2 +-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
Reviewed-by: David Ahern <dsahern@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD
2026-09-02 19:01 [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD Ido Schimmel
2026-09-02 19:50 ` Yaroslav Dudkov
2026-09-02 20:23 ` David Ahern
@ 2026-09-03 7:55 ` Stefano Brivio
2026-09-03 9:28 ` Guillaume Nault
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Stefano Brivio @ 2026-09-03 7:55 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev, davem, kuba, pabeni, edumazet, dsahern, horms, aconole,
gnault, laikabcprice, aroslavdudkov622, rough.rock3059, stable
On Wed, 2 Sep 2026 22:01:12 +0300
Ido Schimmel <idosch@nvidia.com> wrote:
> Bridged UDP tunnels such as VXLAN and GENEVE build an ICMP error packet
> around an overlay packet if the packet is going to exceed the underlay
> path MTU. The ICMP error packet is then injected back into the Rx path
> with the source and destination addresses swapped, so that it will be
> delivered to the overlay source.
>
> If the overlay packet was routed to the UDP tunnel or locally generated,
> then it is already carrying a valid dst entry and this entry is not
> dropped when transforming the packet to an ICMP error packet. This
> causes the IP layer to reuse the dst entry, leading to the ICMP error
> packet being dropped or routed out of the UDP tunnel interface in case
> of forwarding.
>
> Prior to the blamed commit this could not happen, as
> skb_tunnel_check_pmtu() did not build ICMP errors for PACKET_HOST
> packets. Such packets were instead encapsulated and, unless the DF bit
> was set in the outer header, fragmented by the underlay.
>
> Fix this by making sure that the ICMP error packet does not have a valid
> dst entry, thereby forcing the IP layer to perform a route lookup.
>
> Adjust the bridged PMTU exception selftests accordingly. When the
> local sender in ns_a pings the overlay destination with a deadline
> (-w), ping exits on the first socket error before any reply is
> received and returns a non-zero exit code. The test therefore only
> passed because the ICMP error was never delivered. Use a packet count
> (-c) like the ns_c line above it, so that the ICMP error counts
> against the packet budget and the exit code depends on whether echo
> replies were received. This passes with and without the fix.
>
> Fixes: 8930424777e4 ("tunnels: Accept PACKET_HOST in skb_tunnel_check_pmtu().")
> Cc: stable@vger.kernel.org
> Reported-by: Laika Price <laikabcprice@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260614-master-v3-1-9f5060ba1ed1@gmail.com/
> Reported-by: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260901081825.287173-1-aroslavdudkov622@gmail.com/
> Reported-by: Charles Bordet <rough.rock3059@datachamp.fr>
> Closes: https://lore.kernel.org/netdev/aHVhQLPJIhq-SYPM@eldamar.lan/
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Thanks for fixing this and for the clear explanation! It was a rather
subtle and obscure issue.
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
--
Stefano
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD
2026-09-02 19:01 [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD Ido Schimmel
` (2 preceding siblings ...)
2026-09-03 7:55 ` Stefano Brivio
@ 2026-09-03 9:28 ` Guillaume Nault
2026-09-04 0:50 ` patchwork-bot+netdevbpf
2026-09-04 17:09 ` Aaron Conole
5 siblings, 0 replies; 7+ messages in thread
From: Guillaume Nault @ 2026-09-03 9:28 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev, davem, kuba, pabeni, edumazet, dsahern, horms, aconole,
sbrivio, laikabcprice, aroslavdudkov622, rough.rock3059, stable
On Wed, Sep 02, 2026 at 10:01:12PM +0300, Ido Schimmel wrote:
> Bridged UDP tunnels such as VXLAN and GENEVE build an ICMP error packet
> around an overlay packet if the packet is going to exceed the underlay
> path MTU. The ICMP error packet is then injected back into the Rx path
> with the source and destination addresses swapped, so that it will be
> delivered to the overlay source.
>
> If the overlay packet was routed to the UDP tunnel or locally generated,
> then it is already carrying a valid dst entry and this entry is not
> dropped when transforming the packet to an ICMP error packet. This
> causes the IP layer to reuse the dst entry, leading to the ICMP error
> packet being dropped or routed out of the UDP tunnel interface in case
> of forwarding.
Good catch, thanks!
Reviewed-by: Guillaume Nault <gnault@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD
2026-09-02 19:01 [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD Ido Schimmel
` (3 preceding siblings ...)
2026-09-03 9:28 ` Guillaume Nault
@ 2026-09-04 0:50 ` patchwork-bot+netdevbpf
2026-09-04 17:09 ` Aaron Conole
5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-04 0:50 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev, davem, kuba, pabeni, edumazet, dsahern, horms, aconole,
sbrivio, gnault, laikabcprice, aroslavdudkov622, rough.rock3059,
stable
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 2 Sep 2026 22:01:12 +0300 you wrote:
> Bridged UDP tunnels such as VXLAN and GENEVE build an ICMP error packet
> around an overlay packet if the packet is going to exceed the underlay
> path MTU. The ICMP error packet is then injected back into the Rx path
> with the source and destination addresses swapped, so that it will be
> delivered to the overlay source.
>
> If the overlay packet was routed to the UDP tunnel or locally generated,
> then it is already carrying a valid dst entry and this entry is not
> dropped when transforming the packet to an ICMP error packet. This
> causes the IP layer to reuse the dst entry, leading to the ICMP error
> packet being dropped or routed out of the UDP tunnel interface in case
> of forwarding.
>
> [...]
Here is the summary with links:
- [net] tunnels: Drop stale dst when building an ICMP error for PMTUD
https://git.kernel.org/netdev/net/c/b58d74963320
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD
2026-09-02 19:01 [PATCH net] tunnels: Drop stale dst when building an ICMP error for PMTUD Ido Schimmel
` (4 preceding siblings ...)
2026-09-04 0:50 ` patchwork-bot+netdevbpf
@ 2026-09-04 17:09 ` Aaron Conole
5 siblings, 0 replies; 7+ messages in thread
From: Aaron Conole @ 2026-09-04 17:09 UTC (permalink / raw)
To: Ido Schimmel
Cc: netdev, davem, kuba, pabeni, edumazet, dsahern, horms, sbrivio,
gnault, laikabcprice, aroslavdudkov622, rough.rock3059, stable
Ido Schimmel <idosch@nvidia.com> writes:
> Bridged UDP tunnels such as VXLAN and GENEVE build an ICMP error packet
> around an overlay packet if the packet is going to exceed the underlay
> path MTU. The ICMP error packet is then injected back into the Rx path
> with the source and destination addresses swapped, so that it will be
> delivered to the overlay source.
>
> If the overlay packet was routed to the UDP tunnel or locally generated,
> then it is already carrying a valid dst entry and this entry is not
> dropped when transforming the packet to an ICMP error packet. This
> causes the IP layer to reuse the dst entry, leading to the ICMP error
> packet being dropped or routed out of the UDP tunnel interface in case
> of forwarding.
>
> Prior to the blamed commit this could not happen, as
> skb_tunnel_check_pmtu() did not build ICMP errors for PACKET_HOST
> packets. Such packets were instead encapsulated and, unless the DF bit
> was set in the outer header, fragmented by the underlay.
>
> Fix this by making sure that the ICMP error packet does not have a valid
> dst entry, thereby forcing the IP layer to perform a route lookup.
>
> Adjust the bridged PMTU exception selftests accordingly. When the
> local sender in ns_a pings the overlay destination with a deadline
> (-w), ping exits on the first socket error before any reply is
> received and returns a non-zero exit code. The test therefore only
> passed because the ICMP error was never delivered. Use a packet count
> (-c) like the ns_c line above it, so that the ICMP error counts
> against the packet budget and the exit code depends on whether echo
> replies were received. This passes with and without the fix.
>
> Fixes: 8930424777e4 ("tunnels: Accept PACKET_HOST in skb_tunnel_check_pmtu().")
> Cc: stable@vger.kernel.org
> Reported-by: Laika Price <laikabcprice@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260614-master-v3-1-9f5060ba1ed1@gmail.com/
> Reported-by: Yaroslav Dudkov <aroslavdudkov622@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260901081825.287173-1-aroslavdudkov622@gmail.com/
> Reported-by: Charles Bordet <rough.rock3059@datachamp.fr>
> Closes: https://lore.kernel.org/netdev/aHVhQLPJIhq-SYPM@eldamar.lan/
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
Thanks for the detailed analysis. As noted, it was a very obscure and
subtle issue.
Reviewed-by: Aaron Conole <aconole@redhat.com>
^ permalink raw reply [flat|nested] 7+ messages in thread