selftests/bpf: Cover metadata access from a modified skb clone

Demonstrate that, when processing an skb clone, the metadata gets truncated
if the program contains a direct write to either the payload or the
metadata, due to an implicit unclone in the prologue, and otherwise the
dynptr to the metadata is limited to being read-only.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20250814-skb-metadata-thru-dynptr-v7-9-8a39e636e0fb@cloudflare.com
This commit is contained in:
Jakub Sitnicki 2025-08-14 11:59:35 +02:00 • committed by Martin KaFai Lau
commit 403fae5978
3 changed files with 305 additions and 10 deletions