Netdev List
 help / color / mirror / Atom feed
From: Anton Danilov <littlesmilingcloud@gmail.com>
To: netdev@vger.kernel.org
Cc: Eric Dumazet <edumazet@kernel.org>,
	Florian Westphal <fw@strlen.de>, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	Mazin Al Haddad <mazin@getstate.dev>,
	Matthias May <matthias.may@westermo.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v6] ip6_gre: use skb_vlan_inet_prepare() instead of pskb_inet_may_pull()
Date: Wed, 14 Oct 2026 03:53:07 +0300	[thread overview]
Message-ID: <20261014005308.1606362-1-littlesmilingcloud@gmail.com> (raw)
In-Reply-To: <179176844482.434549.5708346025808067831@kernel.org>

Before I send a v7, I would like guidance on how much of this to fix in
net, because the one-line syzbot bug keeps pulling in pre-existing
problems on the ip6gre/ip6erspan transmit path, and each attempt to
cover them has drawn a new report.

The bug itself is narrow: for a VLAN-typed skb->protocol,
pskb_inet_may_pull() checks the length from skb->protocol while the code
that follows parses through the tags, so the inner header is read
without being pulled. Pulling it for that case closes the report.

What makes it larger is that the inner protocol is worked out three
times on the way out, each from a different base:

  - the length check, from skb->data;
  - the ipvX dispatch, from skb->mac_len via skb_protocol();
  - the inherited hop limit in ip6_tnl_xmit(), from the MAC header,
    after the GRE and ERSPAN headers are pushed (b09ab9c92e50).

As long as these three derive the protocol independently, a frame whose
bases disagree breaks one of the pairs: skb->data not at the MAC header
(a frame decoded by act_ife on egress), a tag not at the usual offset
(a DSA conduit's in-band tag), or no MAC header at all (L3 ip6gre). A
patch that lines up one pair leaves another exposed; the ERSPAN COS,
which a separate patch takes from the frame, is a fourth reader with its
own base.

The robust shape I see is to classify the payload once at
ndo_start_xmit and pass the result into ip6_tnl_xmit(), instead of
re-deriving it after the push. That removes the post-push walk and the
cross-file precondition behind it, but it changes the signature of the
exported ip6_tnl_xmit().

So, two questions:

  - for the net/stable fix of the syzbot report, would you prefer the
    minimal change (pull the inner header for a VLAN skb->protocol so
    the length check matches the existing parse, and leave the
    re-parse, the ERSPAN COS and the DSA/act_ife cases as separate
    net-next work), or the fuller rework now?
  - is changing the exported ip6_tnl_xmit() signature acceptable in
    net, or should anything touching it wait for net-next?

I have the measurements for the regression and for the pre-existing
reads and can post either form quickly once the scope is clear.

Thanks,
Anton Danilov

pw-bot: cr

      reply	other threads:[~2026-10-14  0:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  1:25 [PATCH net v6] ip6_gre: use skb_vlan_inet_prepare() instead of pskb_inet_may_pull() Anton Danilov
2026-10-12  1:27 ` netdev-bot+sashiko
2026-10-14  0:53   ` Anton Danilov [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=20261014005308.1606362-1-littlesmilingcloud@gmail.com \
    --to=littlesmilingcloud@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.may@westermo.com \
    --cc=mazin@getstate.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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