Netdev List
 help / color / mirror / Atom feed
From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: "Björn Töpel" <bjorn@kernel.org>
Cc: "Magnus Karlsson" <magnus.karlsson@intel.com>,
	"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Willem de Bruijn" <willemb@google.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	"Simon Horman" <horms@kernel.org>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Song Liu" <song@kernel.org>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"Jiri Olsa" <jolsa@kernel.org>,
	"Emil Tsalapatis" <emil@etsalapatis.com>,
	"Ihor Solodrai" <ihor.solodrai@linux.dev>,
	"Tony Nguyen" <anthony.l.nguyen@intel.com>,
	"Przemek Kitszel" <przemyslaw.kitszel@intel.com>,
	intel-wired-lan@lists.osuosl.org,
	"Clément Lecigne" <clecigne@google.com>
Subject: Re: [PATCH net v2 3/4] intel: Copy the exact length of XSk packets to skbs
Date: Mon, 30 Nov 2026 17:56:00 +0100	[thread overview]
Message-ID: <bfef5114-2a39-45bb-b386-35f2a3b06de1@intel.com> (raw)
In-Reply-To: <20261130123737.125432-4-bjorn@kernel.org>

From: Björn Töpel <bjorn@kernel.org>
Date: Mon, 30 Nov 2026 13:37:34 +0100

> i40e, igb, igc and ixgbe copy an XSk zero-copy packet that the XDP
> program passes into a new skb, and round the length of the copy up to
> a multiple of 8 bytes. The copy then reads up to 7 bytes past the end
> of the data. When the data ends at the end of the last chunk of the
> UMEM, the read hits the guard page after the UMEM mapping and faults.
> 
> On i40e the device can already fill a single-buffer chunk to its end.
> The last patch of this series lets multi-buffer pools and
> bpf_xdp_adjust_tail() reach the end of a chunk on all four.
> 
> Copy the exact length.
> 
> Found by an AI code review agent in review of this series. Reproduced
> on igb in QEMU. An AF_XDP socket in zero copy with 4K chunks and only
> the last chunk of the UMEM in the FILL ring, and an XDP program that
> adds 4 bytes of metadata, grows the tail to the end of the chunk and
> passes the packet:
> 
>   BUG: unable to handle page fault for address: ffa0000001048000
>   RIP: 0010:memcpy+0xc/0x30
>    igb_clean_rx_irq_zc+0x8a7/0x1520
>    igb_poll+0x1039/0x4f50
> 
> With this patch the same test passes.
> 
> Fixes: 6dba29537c0f ("i40e: respect metadata on XSK Rx to skb")
> Fixes: f322a620be69 ("ixgbe: respect metadata on XSK Rx to skb")
> Fixes: f9e61d365baf ("igc: don't reserve excessive XDP_PACKET_HEADROOM on XSK Rx to skb")
> Fixes: 2c6196013f84 ("igb: Add AF_XDP zero-copy Rx support")
> Signed-off-by: Björn Töpel <bjorn@kernel.org>

Acked-by: Alexander Lobakin <aleksander.lobakin@intel.com>

Thanks,
Olek

  reply	other threads:[~2026-11-30 16:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 12:37 [PATCH net v2 0/4] xsk: Keep the shared info of zero-copy buffers in kernel memory Björn Töpel
2026-11-30 12:37 ` [PATCH net v2 1/4] libeth: xsk: Count each XDP_TX buffer on its own Björn Töpel
2026-11-30 16:41   ` Alexander Lobakin
2026-11-30 12:37 ` [PATCH net v2 2/4] xdp: Size zero-copy skbs from the data, not the frame size Björn Töpel
2026-11-30 16:54   ` Alexander Lobakin
2026-11-30 12:37 ` [PATCH net v2 3/4] intel: Copy the exact length of XSk packets to skbs Björn Töpel
2026-11-30 16:56   ` Alexander Lobakin [this message]
2026-11-30 12:37 ` [PATCH net v2 4/4] xsk: Keep the shared info of zero-copy buffers in kernel memory Björn Töpel

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=bfef5114-2a39-45bb-b386-35f2a3b06de1@intel.com \
    --to=aleksander.lobakin@intel.com \
    --cc=andrii@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clecigne@google.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=willemb@google.com \
    --cc=yonghong.song@linux.dev \
    /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