linux/include/net/libeth
Stanislav Fomichev 849b1664db xsk: validate metadata when processing requests
The zero-copy path validates TX metadata while obtaining the descriptor
context, then reads it again later when preparing the hardware request.
User space can change the metadata between those operations and bypass the
original validation.

Validate the metadata in xsk_tx_metadata_request() and use the resulting
flags snapshot for every feature check. Read request fields once so all
zero-copy drivers process only values observed after successful
validation.

Fixes: ca4419f15a ("xsk: Add launch time hardware offload support to XDP Tx metadata")
Cc: Cen Zhang (Microsoft) <blbllhy@gmail.com>
Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20260727161959.885642-7-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-03 16:43:54 -07:00
..
cache.h libeth: add cacheline / struct layout assertion helpers 2024-07-10 10:29:53 -07:00
rx.h libeth: support native XDP and register memory model 2025-06-16 11:40:14 -07:00
tx.h libeth: xsk: add XSk xmit functions 2025-06-16 11:40:15 -07:00
types.h libeth: xdp: add XDP prog run and verdict result handling 2025-06-16 11:40:14 -07:00
xdp.h libeth: xdp: Disable generic kCFI pass for libeth_xdp_tx_xmit_bulk() 2025-10-29 20:04:55 -07:00
xsk.h xsk: validate metadata when processing requests 2026-08-03 16:43:54 -07:00