Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Shuai Liu <847807867@qq.com>,
	netdev@vger.kernel.org, steffen.klassert@secunet.com
Cc: herbert@gondor.apana.org.au, edumazet@kernel.org,
	kuba@kernel.org, horms@kernel.org, q.h.hack.winter@gmail.com,
	stable@vger.kernel.org,
	syzbot+d29af9ef5c96a3f5e96c@syzkaller.appspotmail.com
Subject: Re: [PATCH net] xfrm: interface: drop non-IP packets before pskb_inet_may_pull()
Date: Wed, 25 Nov 2026 13:22:39 +0100	[thread overview]
Message-ID: <f38e588a-91cc-4ded-a0fa-08f129b1c920@redhat.com> (raw)
In-Reply-To: <tencent_46F20906773869221623F9FA26275C133107@qq.com>

On 11/19/26 06:08, Shuai Liu wrote:
> AF_XDP sockets bound to an xfrm interface submit skbs with
> skb->protocol unset (0) and skb->network_header still 0 from the
> __alloc_skb() zero-initialization; skb_reserve() only moves data
> NET_SKB_PAD bytes into the headroom.
> 
> Since commit 86de3a1118a16 ("xfrm: interface: validate the IP header
> on xmit"), xfrmi_xmit() calls pskb_inet_may_pull() unconditionally.
> For such a skb, pskb_inet_may_pull_reason() selects nhlen = 0 for the
> unknown protocol and pskb_may_pull_reason() receives
> len = skb_network_offset(skb) = network_header - data = -64, which as
> unsigned int exceeds INT_MAX and trips the
> DEBUG_NET_WARN_ON_ONCE(len > INT_MAX) in pskb_may_pull_reason():
> 
>    WARNING: ./include/linux/skbuff.h:2856 at pskb_may_pull_reason [inline]
>    WARNING: ./include/linux/skbuff.h:3286 at pskb_network_may_pull_reason [inline]
>    WARNING: ./include/net/ip_tunnels.h:483 at pskb_inet_may_pull_reason [inline]
>    WARNING: ./include/net/ip_tunnels.h:488 at pskb_inet_may_pull [inline]
>    WARNING: ./include/net/ip_tunnels.h:488 at xfrmi_xmit+0x1844/0x1eb0
>      net/xfrm/xfrm_interface_core.c:534
>    RIP: 0010:pskb_may_pull_reason include/linux/skbuff.h:2856 [inline]
>    Call Trace:
>     __dev_direct_xmit+0x4b6/0x730 net/core/dev.c:5164
>     __xsk_generic_xmit net/xdp/xsk.c:1288 [inline]
>     xsk_generic_xmit+0x27d8/0x47a0 net/xdp/xsk.c:1344
>     xsk_poll+0x326/0x670 net/xdp/xsk.c:1472
> 
> The packet is dropped by the pull returning PKT_TOO_SMALL and hitting
> the default case afterwards anyway, so the only visible effect is the
> warning; reject unknown protocols before the pull to restore the
> pre-86de3a1118a16 behavior of dropping them silently via the switch
> default.
> 
> Reported-by: syzbot+d29af9ef5c96a3f5e96c@syzkaller.appspotmail.com
> Closes: https://syzbot.org/bug?extid=d29af9ef5c96a3f5e96c
> Fixes: 86de3a1118a16 ("xfrm: interface: validate the IP header on xmit")
> Cc: stable@vger.kernel.org

The blamed commit is in the current release, Cc: stable is not needed
No need to resubmit just for this, I can drop the tag while applying.

> Signed-off-by: Shuai Liu <847807867@qq.com>
@Steffen: looks good?

/P


  reply	other threads:[~2026-11-25 12:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 16:14 [syzbot] [net?] WARNING in xfrmi_xmit syzbot
2026-11-19  5:08 ` [PATCH net] xfrm: interface: drop non-IP packets before pskb_inet_may_pull() Shuai Liu
2026-11-25 12:22   ` Paolo Abeni [this message]
2026-11-25 12:24     ` Paolo Abeni

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=f38e588a-91cc-4ded-a0fa-08f129b1c920@redhat.com \
    --to=pabeni@redhat.com \
    --cc=847807867@qq.com \
    --cc=edumazet@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=q.h.hack.winter@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=syzbot+d29af9ef5c96a3f5e96c@syzkaller.appspotmail.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