From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Alexander Lobakin <aleksander.lobakin@intel.com>,
Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: netdev@vger.kernel.org, Kenneth Lee <kennethbwlee@snu.ac.kr>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Kuniyuki Iwashima <kuniyu@google.com>,
Hangbin Liu <liuhangbin@gmail.com>,
Krishna Kumar <krikku@gmail.com>,
Martin Karsten <mkarsten@uwaterloo.ca>,
Martin Willi <martin@strongswan.org>,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net-next] net: xdp: don't assume an Ethernet header in generic XDP
Date: Tue, 18 Aug 2026 20:09:34 +0200 [thread overview]
Message-ID: <875x179u75.fsf@toke.dk> (raw)
In-Reply-To: <d9c3234b-99ac-430c-ab62-9b1412af3461@intel.com>
Alexander Lobakin <aleksander.lobakin@intel.com> writes:
> From: Jiayuan Chen <jiayuan.chen@linux.dev>
> Date: Thu, 13 Aug 2026 19:32:24 +0800
>
>> Kenneth Lee reported a bug [1]:
>>
>> skb_vlan_push got skb with skb->data not at mac header (offset 14)
>> WARNING: net/core/skbuff.c:6474 at skb_vlan_push+0x5ec/0x8a0
>> ____bpf_skb_vlan_push net/core/filter.c:3239 [inline]
>> bpf_skb_vlan_push+0x216/0x8b0 net/core/filter.c:3229
>> bpf_prog_run_data_pointers+0x17c/0x240 include/linux/filter.h:917
>> tcf_bpf_act+0x31c/0x940 net/sched/act_bpf.c:50
>> tcf_action_exec+0x2c1/0x720 net/sched/act_api.c:1147
>> tcf_classify+0x6e4/0x1080 net/sched/cls_api.c:1860
>> tc_run+0x31c/0x5d0 net/core/dev.c:4411
>> sch_handle_ingress net/core/dev.c:4486 [inline]
>> __netif_receive_skb_core+0x141b/0x2ec0 net/core/dev.c:6054
>>
>> bpf_prog_run_generic_xdp() just assumes xdp->data is an Ethernet header:
> Most XDP programs expect Ethernet header at the beginning of a frame.
> Unless you write a custom one which doesn't.
> But then you may face that XDP_TX, XDP_REDIRECT won't work properly --
> cpumap Rx, each .ndo_xdp_xmit() implementation -- all expect Ethernet
> header at the beginning.
Yeah, I don't think we should start messing with the "XDP is Ethernet
only" assumption at this point...
-Toke
prev parent reply other threads:[~2026-08-18 18:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 11:32 [PATCH net-next] net: xdp: don't assume an Ethernet header in generic XDP Jiayuan Chen
2026-08-14 11:33 ` sashiko-bot
2026-08-14 21:09 ` Jakub Kicinski
2026-08-18 14:22 ` Alexander Lobakin
2026-08-18 18:09 ` Toke Høiland-Jørgensen [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=875x179u75.fsf@toke.dk \
--to=toke@redhat.com \
--cc=aleksander.lobakin@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=jiayuan.chen@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=kennethbwlee@snu.ac.kr \
--cc=krikku@gmail.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=martin@strongswan.org \
--cc=mkarsten@uwaterloo.ca \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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;
as well as URLs for NNTP newsgroup(s).