Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Shuangpeng Bai <shuangpeng.kernel@gmail.com>,
	Davide Caratti <dcaratti@redhat.com>
Subject: Re: [PATCH net] ip6_gre: check tunnel info before xmit in ip6gre_tunnel_xmit
Date: Sun, 30 Aug 2026 13:47:05 +0300	[thread overview]
Message-ID: <20260830104705.GA2834418@shredder> (raw)
In-Reply-To: <20260828103731.1951815-1-edumazet@google.com>

On Fri, Aug 28, 2026 at 10:37:31AM +0000, Eric Dumazet wrote:
> Shuangpeng Bai reported a KASAN slab-use-after-free in
> ip6gre_tunnel_xmit().
> 
> The precise KASAN bug was caused by ip6_tnl_xmit() consuming the
> skb during headroom expansion and returning an error, while
> ip6gre_tunnel_xmit() still held the stale pointer and called
> skb_tunnel_info_txcheck(skb) at tx_err. That specific bug was fixed by
> commit 87f21b59ddc6 ("ip6_tunnel: use skb_cow_head() in ip6_tnl_xmit()").
> 
> However, calling skb_tunnel_info_txcheck(skb) at the tx_err label
> after the transmission attempt remains problematic:
> 
> Downstream helpers like ip6_tnl_xmit() call skb_scrub_packet(),
> which drops the skb's metadata_dst before transmission. If an error
> occurs later during transmit, inspecting skb at tx_err sees a scrubbed
> dst and misclassifies tx_errors vs tx_dropped.
> 
> Commit e5f7e211b6aa ("ip6gre: avoid tx_error when sending MLD/DAD on
> external tunnels") already handled this correctly in
> ip6erspan_tunnel_xmit() by checking and caching tun_info before
> transmit.
> 
> Align ip6gre_tunnel_xmit() with ip6erspan_tunnel_xmit() by caching
> tun_info before xmit and checking it at tx_err.
> 
> Fixes: e5f7e211b6aa ("ip6gre: avoid tx_error when sending MLD/DAD on external tunnels")
> Reported-by: Shuangpeng Bai <shuangpeng.kernel@gmail.com>
> Closes: https://lore.kernel.org/netdev/20260819062224.3197349-1-shuangpeng.kernel@gmail.com/
> Cc: Davide Caratti <dcaratti@redhat.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

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

  reply	other threads:[~2026-08-30 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-28 10:37 [PATCH net] ip6_gre: check tunnel info before xmit in ip6gre_tunnel_xmit Eric Dumazet
2026-08-30 10:47 ` Ido Schimmel [this message]
2026-09-01  1:10 ` patchwork-bot+netdevbpf

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=20260830104705.GA2834418@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuangpeng.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