linux/net/xdp
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
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile xsk: Introduce AF_XDP buffer allocation API 2020-05-21 17:31:26 -07:00
xdp_umem.c xsk: require at least 16 bytes of TX metadata 2026-08-03 16:43:53 -07:00
xdp_umem.h xsk: Fix umem cleanup bug at socket destruct 2020-11-20 15:52:39 +01:00
xsk_buff_pool.c xsk: validate metadata when processing requests 2026-08-03 16:43:54 -07:00
xsk_diag.c net: change sock.sk_ino and sock_i_ino() to u64 2026-03-06 14:31:26 +01:00
xsk_queue.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xsk_queue.h xsk: reclaim invalid Tx descriptors in ZC batch path 2026-07-24 15:12:14 -07:00
xsk.c xsk: validate launch-time metadata size 2026-08-03 16:43:54 -07:00
xsk.h xsk: remove repeated defines 2026-03-16 19:28:21 -07:00
xskmap.c xskmap: reject TX-only AF_XDP sockets 2026-05-09 16:17:01 -07:00