All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Fomichev <stfomichev@gmail.com>
To: "Rao, Nikhil" <nikhirao@amd.com>
Cc: magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
	sdf@fomichev.me, netdev@vger.kernel.org
Subject: Re: net/xdp: Potential issue with xp_aligned_validate_desc() in multi-buffer packets
Date: Tue, 3 Feb 2026 18:03:37 -0800	[thread overview]
Message-ID: <aYKo-YeGpsl8ngeK@mini-arch> (raw)
In-Reply-To: <c4b5955a-8ec6-47ac-913d-4a959e0b477e@amd.com>

On 02/03, Rao, Nikhil wrote:
> Hi XDP maintainers,
> 
> I have noticed a potential issue with multi-buffer packet support in the
> xp_aligned_validate_desc() function in net/xdp/xsk_queue.h.
> 
> In xp_aligned_validate_desc(), the validation always adjusts the address
> and length by pool->tx_metadata_len:
> 
>   u64 addr = desc->addr - pool->tx_metadata_len;
>   u64 len = desc->len + pool->tx_metadata_len;
> 
> However, in multi-buffer XDP packets, only the first descriptor contains
> TX metadata. Subsequent descriptors do not have
> metadata and should not be validated with this adjustment.
> 
> This causes validation failures for the 2nd buffer onward in
> multi-buffer packets when TX metadata is enabled.
> 
> The same issue exists in xp_unaligned_validate_desc() as well.
> 
> I'm happy to submit a patch if this is indeed a bug. Please let me know
> your thoughts.

I think your assessment is correct. Can you try to extend
prog_tests/xdp_metadata.c to send a mbuf packet? I don't think we have
any real test coverage for the metadata+mbuf..

      reply	other threads:[~2026-02-04  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 19:58 net/xdp: Potential issue with xp_aligned_validate_desc() in multi-buffer packets Rao, Nikhil
2026-02-04  2:03 ` Stanislav Fomichev [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=aYKo-YeGpsl8ngeK@mini-arch \
    --to=stfomichev@gmail.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikhirao@amd.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 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.