Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
	Chengfeng Ye <nicoyip.dev@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net v3] fou: reserve headroom before pushing the encap header
Date: Wed, 18 Nov 2026 16:17:32 +0200	[thread overview]
Message-ID: <20261118141732.GA1261066@shredder> (raw)
In-Reply-To: <20261116113845.166280-1-theodorlarionov@gmail.com>

On Mon, Nov 16, 2026 at 02:38:45PM +0300, Theodor Arsenij Larionov Trichkine wrote:
> ip_tunnel_xmit() and ip_md_tunnel_xmit() push the encap header before
> reserving headroom. A packet redirected into the tunnel (tc mirred, nft
> fwd/dup) keeps the headroom of its original device, so fou_build_udp()
> panics:
> 
>   kernel BUG at net/core/skbuff.c:214!
>   Call Trace:
>    skb_push+0xcc/0xf0
>    fou_build_udp+0x2f/0x380
>    gue_build_header+0xfa/0x150
>    ip_tunnel_xmit+0x87f/0x21c0
> 
> With a mirred mirror, the push overwrites the original packet instead.
> Reachable with CAP_NET_ADMIN in a user namespace.
> 
> Reserve the headroom in fou_build_header() and gue_build_header(); GUE
> sizes and builds the header from one copy of the encap fields. The skb
> head may move, so reload inner_iph after ip_tunnel_encap() and read
> tnl_params, which points into the head for GRE with header_ops, before
> the call. sit's ipip6_tunnel_xmit() holds no head pointer across it.
> 
> Fixes: 56328486539d ("net: Changes to ip_tunnel to support foo-over-udp encapsulation")
> Fixes: ac931d4cdec3 ("ipip,ip_tunnel,sit: Add FOU support for externally controlled ipip devices")
> Reported-by: Chengfeng Ye <nicoyip.dev@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260801060115.3538849-1-nicoyip.dev@gmail.com/
> Cc: stable@vger.kernel.org
> Signed-off-by: Theodor Arsenij Larionov Trichkine <theodorlarionov@gmail.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

      reply	other threads:[~2026-11-18 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 11:38 [PATCH net v3] fou: reserve headroom before pushing the encap header Theodor Arsenij Larionov Trichkine
2026-11-18 14:17 ` 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=20261118141732.GA1261066@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicoyip.dev@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=theodorlarionov@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