]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xsk: validate launch-time metadata size
authorStanislav Fomichev <sdf.kernel@gmail.com>
Mon, 27 Jul 2026 16:19:57 +0000 (09:19 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 3 Aug 2026 23:43:54 +0000 (16:43 -0700)
commit439ce2dddf3d22129b9113a7881637256a35e936
tree51c18dd54dccad9a8e99c6d46bc6364026c62243
parent9f60a67df8d3c862503bee62bada8e7089cba438
xsk: validate launch-time metadata size

Launch-time metadata extends beyond the first 16 bytes of struct
xsk_tx_metadata. Reject the request when the registered metadata area does
not contain the complete field.

Snapshot the validated flags for the generic transmit path and use that
snapshot for request and completion processing, avoiding inconsistent
decisions if user space changes the flags concurrently.

Note that only xsk_skb_metadata is properly using the flags,
__xsk_buff_get_metadata ignores them. Next commits address that.

Fixes: ca4419f15abd ("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-5-sdf@fomichev.me
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/xdp_sock_drv.h
net/xdp/xsk.c