Netdev List
 help / color / mirror / Atom feed
From: "dongchenchen (A)" <dongchenchen2@huawei.com>
To: Eric Dumazet <edumazet@google.com>
Cc: <pablo@netfilter.org>, <laforge@gnumonks.org>,
	<andrew+netdev@lunn.ch>, <davem@davemloft.net>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <horms@kernel.org>, <dsahern@kernel.org>,
	<kees@kernel.org>, <netdev@vger.kernel.org>,
	<osmocom-net-gprs@lists.osmocom.org>,
	<zhangchangzhong@huawei.com>,
	<syzbot+83181a31faf9455499c5@syzkaller.appspotmail.com>
Subject: Re: [PATCH net v2] net: iptunnel: fix stale transport header during tunnel decapsulation
Date: Tue, 25 Aug 2026 19:30:04 +0800	[thread overview]
Message-ID: <a4576449-7435-4d57-b350-3558de893730@huawei.com> (raw)
In-Reply-To: <CANn89iJwWL9NdC19XbSFq7sf_tsZS96PTXWgO3oUMGJRkA0g-w@mail.gmail.com>



在 2026/8/25 17:59, Eric Dumazet 写道:
> On Tue, Aug 25, 2026 at 11:41 AM Dong Chenchen <dongchenchen2@huawei.com> wrote:
>>
>> Syzbot reported a crash in qdisc_pkt_len_segs_init() caused by a stale
>> transport_header offset after tunnel decapsulation.
>>
>>
>> The issue is completely latent until qdisc read transport header in
>> commit 7fb4c1967011 ("net: pull headers in qdisc_pkt_len_segs_init()").
>> The crash requires four conditions to line up:
>>
>> 1. The incoming packet is encapsulated and carries GSO metadata. The outer
>>     transport header offset is stored in skb->transport_header while the
>>     packet is still in the outer tunnel context.
>> 2. The tunnel receiver strips the outer headers. skb->data is advanced to
>>     the inner frame, but skb->transport_header is left pointing to the
>>     now-removed outer L4 header, so it becomes a negative offset relative to
>>     the new data.
>> 3. The inner frame is not delivered to the local IP stack. Instead, it
>>     is forwarded at L2 by a bridge or HSR, so ip_rcv_core() never runs and
>>     the transport header is not reset to the inner L4 offset.
>> 4. The forwarding path calls __dev_queue_xmit(), which enters
>>     qdisc_pkt_len_segs_init(). That function computes the GSO header length
>>     from skb_transport_offset(skb). Because the offset is negative, the
>>     unsigned cast overflows and pskb_may_pull(skb, hdr_len +
>>     sizeof(struct tcphdr)) reads past the end of the skb, triggering a
>>     KASAN fault or page fault.
>>
>> The issue specifically requires GSO packets (shinfo->gso_size != 0), which
>> are processed/aggregated through gro_cells. Fix this by clearing
>> transport_header to the ~0U sentinel in gro_cell for all tunnnel driver.
>> GTP does not support GRO/GSO, drop the evil GSO packets in GTP directly.
>>
>> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>> Reported-by: syzbot+83181a31faf9455499c5@syzkaller.appspotmail.com
>> Closes: https://lore.kernel.org/all/69de2bee.a00a0220.475f0.0041.GAE@google.com/T/
>> Suggested-by: Eric Dumazet <edumazet@google.com>
>> Signed-off-by: Dong Chenchen <dongchenchen2@huawei.com>
>> ---
>>   drivers/net/gtp.c      | 5 +++++
>>   include/linux/skbuff.h | 5 +++++
>>   net/core/gro_cells.c   | 2 ++
>>   3 files changed, 12 insertions(+)
>>
>> diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
>> index 9a12cc53da00..fbf617b1acc9 100644
>> --- a/drivers/net/gtp.c
>> +++ b/drivers/net/gtp.c
>> @@ -312,6 +312,11 @@ static int gtp_inner_proto(struct sk_buff *skb, unsigned int hdrlen,
>>   static int gtp_rx(struct pdp_ctx *pctx, struct sk_buff *skb,
>>                    unsigned int hdrlen, unsigned int role, __u16 inner_proto)
>>   {
>> +       if (skb_is_gso(skb)) {
>> +               netdev_dbg(pctx->dev, "GSO is not support in GTP\n");
> 
> Patch looks good to me but there is a small typo here.
> 
>                      netdev_dbg(pctx->dev, "GSO is not supported in GTP\n");
> 
> Reviewed-by: Eric Dumazet <edumazet@google.com>
> 
> Thanks.

Thanks for review!
v3 will be sent


  reply	other threads:[~2026-08-25 11:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25  9:50 [PATCH net v2] net: iptunnel: fix stale transport header during tunnel decapsulation Dong Chenchen
2026-08-25  9:59 ` Eric Dumazet
2026-08-25 11:30   ` dongchenchen (A) [this message]
2026-08-25 22:20   ` Pablo Neira Ayuso

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=a4576449-7435-4d57-b350-3558de893730@huawei.com \
    --to=dongchenchen2@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=laforge@gnumonks.org \
    --cc=netdev@vger.kernel.org \
    --cc=osmocom-net-gprs@lists.osmocom.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=syzbot+83181a31faf9455499c5@syzkaller.appspotmail.com \
    --cc=zhangchangzhong@huawei.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