* net/xdp: Potential issue with xp_aligned_validate_desc() in multi-buffer packets
@ 2026-02-03 19:58 Rao, Nikhil
2026-02-04 2:03 ` Stanislav Fomichev
0 siblings, 1 reply; 2+ messages in thread
From: Rao, Nikhil @ 2026-02-03 19:58 UTC (permalink / raw)
To: magnus.karlsson, maciej.fijalkowski; +Cc: sdf, netdev
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: net/xdp: Potential issue with xp_aligned_validate_desc() in multi-buffer packets
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
0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Fomichev @ 2026-02-04 2:03 UTC (permalink / raw)
To: Rao, Nikhil; +Cc: magnus.karlsson, maciej.fijalkowski, sdf, netdev
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..
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-04 2:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox