From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Eric Dumazet <edumazet@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>
Cc: Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, Eric Dumazet <edumazet@kernel.org>,
Kyle Zeng <kylebot@openai.com>
Subject: Re: [PATCH net] net: gro: compare skb->protocol in gro_list_prepare()
Date: Fri, 06 Nov 2026 15:21:52 -0500 [thread overview]
Message-ID: <willemdebruijn.kernel.2e09a035794e5@gmail.com> (raw)
In-Reply-To: <20261106195136.2496777-1-edumazet@kernel.org>
Eric Dumazet wrote:
> gro_list_prepare() checks whether a held packet may belong to the same
> flow as the incoming one by comparing the device, VLAN tag, metadata
> and the link-layer header, using dev->hard_header_len as its length.
>
> On devices without a link-layer header (hard_header_len == 0), such as
> L3 GRE tunnels, no compared byte carries the outer protocol:
> skb->protocol comes from the tunnel header. Packets of different
> protocols can then stay eligible, and the GRO handler selected from the
> incoming skb->protocol parses the held packet with the wrong layout.
>
> For example, take an IPv4/UDP packet held by UDP GRO and a
> VLAN/IPv4/TCP packet received on the same ipgre device.
> vlan_gro_receive() reads the first four bytes of the held IPv4 header
> as a VLAN header. With crafted values, the held packet survives up to
> tcp_gro_receive(), which uses its UDP header as a TCP header. With a
> short linear part, the FIN/PSH update of the held packet's TCP flags
> can then write into skb_shared_info.
>
> Nested GRO handlers (VLAN, GRE, IPv4, IPv6) already compare their own
> next-protocol field. Only the outermost protocol was not checked.
>
> Compare skb->protocol too. On Ethernet devices this is redundant with
> compare_ether_header(), but it is cheap.
>
> Fixes: 60769a5dcd87 ("ipv4: gre: add GRO capability")
> Reported-by: Kyle Zeng <kylebot@openai.com>
> Signed-off-by: Eric Dumaze <edumazet@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
next prev parent reply other threads:[~2026-11-06 20:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 19:51 [PATCH net] net: gro: compare skb->protocol in gro_list_prepare() Eric Dumazet
2026-11-06 20:21 ` Willem de Bruijn [this message]
2026-11-07 20:28 ` netdev-bot+sashiko
2026-11-09 16:37 ` Eric Dumazet
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=willemdebruijn.kernel.2e09a035794e5@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=kylebot@openai.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.