๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Eric Dumazet Wed, 28 Oct 2026 04:19
Re: Subject: [PATCH net] ip_tunnel: reload inner IP header after ip_tunnel_encap()
#8123
Author: Eric Dumazet
Date: Wed, 28 Oct 2026 04:19
48 lines
10680 bytes
Le mer. 28 oct. 2026 ร  04:21, bo cao <treebacker@foxmail.com> a รฉcrit :
>
> ip_tunnel_xmit() and ip_md_tunnel_xmit() cache the inner IP header
> pointer at function entry and continue using it after
> ip_tunnel_encap().
>
> For GSO skbs over a FOU or GUE encap, ip_tunnel_encap() calls
> iptunnel_handle_offloads(), which calls skb_header_unclone(); when
> the skb header is cloned, that calls pskb_expand_head() and moves
> the skb head.

This can not happen.

All callers of ip_tunnel_xmit() and ip_md_tunnel_xmit() already call
iptunnel_handle_offloads() (ipip_tunnel_xmit(), sit_tunnel_xmit__())
or gre_handle_offloads() (all ip_gre.c paths) before entering
ip_tunnel.c. For GSO packets, this performs skb_header_unclone()
before inner_iph is read.

Nothing clones the skb between this point and ip_tunnel_encap(), so the
second skb_header_unclone() done from fou_build_header() or
gue_build_header() is a nop, and pskb_expand_head() is not called.

The SIT bug fixed in f0e42f0c4337 was different: ipip6_tunnel_xmit()
was reading iph6 _before_ its own iptunnel_handle_offloads() call.

> A kprobe on pskb_expand_head() with stack traces recorded 74019 hits
> in 8 seconds of flooding, every one with the tunnel xmit path in the
> stack (frames: pskb_expand_head <- ipip_tunnel_xmit <-
> dev_hard_start_xmit <- __dev_queue_xmit <- ip_finish_output2 <- ...
> <- udp_sendmsg).

These are the expected pskb_expand_head() calls from
iptunnel_handle_offloads() in ipip_tunnel_xmit(), unsharing the clone
made by your AF_PACKET tap. This happens before ip_tunnel_xmit()
is called. If the head were moved from ip_tunnel_encap(), you would
see fou_build_header() and ip_tunnel_xmit() in these stacks.

Unless you can show a path where the header is cloned between
the caller's offload handling and ip_tunnel_encap(), or provide
a KASAN report, this patch is not fixing a bug.

Also, please avoid "Subject: Subject:" and base64 encoded mails;
see Documentation/process/email-clients.rst

pw-bot: reject
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