All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
	<magnus.karlsson@intel.com>, <stfomichev@gmail.com>,
	<pabeni@redhat.com>, <horms@kernel.org>,
	<larysa.zaremba@intel.com>, <aleksander.lobakin@intel.com>,
	<bjorn@kernel.org>, Stanislav Fomichev <sdf@fomichev.me>
Subject: Re: [PATCH v6 net 1/8] xsk: tighten UMEM headroom validation to account for tailroom and min frame
Date: Sat, 4 Apr 2026 12:07:00 +0200	[thread overview]
Message-ID: <adDixAXZRpvcRJkR@boxer> (raw)
In-Reply-To: <20260403170126.276f9623@kernel.org>

On Fri, Apr 03, 2026 at 05:01:26PM -0700, Jakub Kicinski wrote:
> On Thu,  2 Apr 2026 17:49:51 +0200 Maciej Fijalkowski wrote:
> > The current headroom validation in xdp_umem_reg() could leave us with
> > insufficient space dedicated to even receive minimum-sized ethernet
> > frame. Furthermore if multi-buffer would come to play then
> > skb_shared_info stored at the end of XSK frame would be corrupted.
> > 
> > HW typically works with 128-aligned sizes so let us provide this value
> > as bare minimum.
> > 
> > Multi-buffer setting is known later in the configuration process so
> > besides accounting for 128 bytes, let us also take care of tailroom space
> > upfront.
> 
> I guess it's a bit late to ask this, but am I the only one that has
> weird feelings about shinfo living in user-mapped memory?

This was the approach was picked to be consistent with XDP side and allow
to use mbuf related helpers. I can imagine you would be suggesting to pick
up pages from system page pool but that would be a major refactor (however
I have not put much not thought into it - i'm here without a coffee and in
easter mode).

Outside of this rewrite this set fixes existing memory corruption, so I
feel it is needed and we can think how should we address the concern you
are bringing up later?

  reply	other threads:[~2026-04-04 10:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 15:49 [PATCH v6 net 0/8] xsk: tailroom reservation and MTU validation Maciej Fijalkowski
2026-04-02 15:49 ` [PATCH v6 net 1/8] xsk: tighten UMEM headroom validation to account for tailroom and min frame Maciej Fijalkowski
2026-04-04  0:01   ` Jakub Kicinski
2026-04-04 10:07     ` Maciej Fijalkowski [this message]
2026-04-02 15:49 ` [PATCH v6 net 2/8] xsk: respect tailroom for ZC setups Maciej Fijalkowski
2026-04-02 15:49 ` [PATCH v6 net 3/8] xsk: fix XDP_UMEM_SG_FLAG issues Maciej Fijalkowski
2026-04-03 23:56   ` Jakub Kicinski
2026-04-04 10:11     ` Maciej Fijalkowski
2026-04-07  1:45       ` Jakub Kicinski
2026-04-02 15:49 ` [PATCH v6 net 4/8] xsk: validate MTU against usable frame size on bind Maciej Fijalkowski
2026-04-04  0:03   ` Jakub Kicinski
2026-04-04 10:02     ` Maciej Fijalkowski
2026-04-06 18:00       ` Jakub Kicinski
2026-04-02 15:49 ` [PATCH v6 net 5/8] selftests: bpf: introduce a common routine for reading procfs Maciej Fijalkowski
2026-04-02 15:49 ` [PATCH v6 net 6/8] selftests: bpf: fix pkt grow tests Maciej Fijalkowski
2026-04-02 15:49 ` [PATCH v6 net 7/8] selftests: bpf: have a separate variable for drop test Maciej Fijalkowski
2026-04-02 15:49 ` [PATCH v6 net 8/8] selftests: bpf: adjust rx_dropped xskxceiver's test to respect tailroom Maciej Fijalkowski
2026-04-07  1:50 ` [PATCH v6 net 0/8] xsk: tailroom reservation and MTU validation patchwork-bot+netdevbpf

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=adDixAXZRpvcRJkR@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=larysa.zaremba@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@fomichev.me \
    --cc=stfomichev@gmail.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.