]> git.ipfire.org Git - thirdparty/linux.git/commit
net: Helper to move packet data and metadata after skb_push/pull
authorJakub Sitnicki <jakub@cloudflare.com>
Wed, 5 Nov 2025 20:19:38 +0000 (21:19 +0100)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 10 Nov 2025 18:52:31 +0000 (10:52 -0800)
commit8989d328dfe7c7a3b9f4b9f0ef60006d277f81cc
tree853def18c21561b7fb19625f8739062d74101d10
parenta0c3aefb08cd81864b17c23c25b388dba90b9dad
net: Helper to move packet data and metadata after skb_push/pull

Lay groundwork for fixing BPF helpers available to TC(X) programs.

When skb_push() or skb_pull() is called in a TC(X) ingress BPF program, the
skb metadata must be kept in front of the MAC header. Otherwise, BPF
programs using the __sk_buff->data_meta pseudo-pointer lose access to it.

Introduce a helper that moves both metadata and a specified number of
packet data bytes together, suitable as a drop-in replacement for
memmove().

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-1-5ceb08a9b37b@cloudflare.com
include/linux/skbuff.h