public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rao, Nikhil" <nikhirao@amd.com>
To: magnus.karlsson@intel.com, maciej.fijalkowski@intel.com
Cc: sdf@fomichev.me, netdev@vger.kernel.org
Subject: net/xdp: Potential issue with xp_aligned_validate_desc() in multi-buffer packets
Date: Tue, 3 Feb 2026 11:58:13 -0800	[thread overview]
Message-ID: <c4b5955a-8ec6-47ac-913d-4a959e0b477e@amd.com> (raw)

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.

Thanks,
Nikhil


             reply	other threads:[~2026-02-03 19:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 19:58 Rao, Nikhil [this message]
2026-02-04  2:03 ` net/xdp: Potential issue with xp_aligned_validate_desc() in multi-buffer packets Stanislav Fomichev

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=c4b5955a-8ec6-47ac-913d-4a959e0b477e@amd.com \
    --to=nikhirao@amd.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --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