Skip to content

Commit a41ab27

Browse files
jsitnickiKernel Patches Daemon
authored andcommitted
net: Preserve metadata on pskb_expand_head
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. Let the skb metadata remain in the newly created copy of head. Signed-off-by: Jakub Sitnicki <[email protected]>
1 parent 2b803ce commit a41ab27

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

net/core/skbuff.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,8 +2289,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
22892289
skb->nohdr = 0;
22902290
atomic_set(&skb_shinfo(skb)->dataref, 1);
22912291

2292-
skb_metadata_clear(skb);
2293-
22942292
/* It is not generally safe to change skb->truesize.
22952293
* For the moment, we really care of rx path, or
22962294
* when skb is orphaned (not attached to a socket).

0 commit comments

Comments
 (0)