Thread (1 message) 1 message, 1 author, 2025-10-24

Re: [PATCH bpf-next v2 01/15] net: Preserve metadata on pskb_expand_head

From: Jakub Sitnicki <jakub@cloudflare.com>
Date: 2025-10-24 12:17:59
Also in: bpf

On Thu, Oct 23, 2025 at 05:51 PM -07, Jakub Kicinski wrote:
On Sun, 19 Oct 2025 14:45:25 +0200 Jakub Sitnicki wrote:
quoted
pskb_expand_head() copies headroom, including skb metadata, into the newly
allocated head, but then clears the metadata. As a result, metadata is lost
when BPF helpers trigger an skb head reallocation.
True, then again if someone is reallocating headroom they may very well
push a header after, shifting metadata into an uninitialized part of
the headroom. Not sure we can do much about that, but perhaps worth
being more explicit in the commit msg?
This is where the skb_data_move() helper, proposed by the next patch,
comes in. We will try to move the metadata out of the way if possible,
and clear it if don't have enough headroom left. That approach relies on
all pskb_expand_head users adopting the helper, which is no simple task.

I can add guidance for pskb_expand_head users to the commit description,
or maybe better yet, add a note in pskb_expand_head docs.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help