]> git.ipfire.org Git - thirdparty/linux.git/commit
bpf: Unclone skb head on bpf_dynptr_write to skb metadata
authorJakub Sitnicki <jakub@cloudflare.com>
Wed, 5 Nov 2025 20:19:40 +0000 (21:19 +0100)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 10 Nov 2025 18:52:31 +0000 (10:52 -0800)
commitf38499ff45f567c932d0911e6a30b8ca022b9b52
tree54832a54e7699c664e5163dacb10e7b829a7d133
parent290fc0be09e2f6e08754782616bb7e67f8191fa1
bpf: Unclone skb head on bpf_dynptr_write to skb metadata

Currently bpf_dynptr_from_skb_meta() marks the dynptr as read-only when
the skb is cloned, preventing writes to metadata.

Remove this restriction and unclone the skb head on bpf_dynptr_write() to
metadata, now that the metadata is preserved during uncloning. This makes
metadata dynptr consistent with skb dynptr, allowing writes regardless of
whether the skb is cloned.

Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20251105-skb-meta-rx-path-v4-3-5ceb08a9b37b@cloudflare.com
include/linux/filter.h
kernel/bpf/helpers.c
net/core/filter.c