Skip to content

Commit 4f9db60

Browse files
jsitnickiKernel Patches Daemon
authored andcommitted
bpf: Make bpf_skb_vlan_pop helper metadata-safe
Use the metadata-aware helper to move packet bytes after skb_pull(), ensuring metadata remains valid after calling the BPF helper. Signed-off-by: Jakub Sitnicki <[email protected]>
1 parent 01aa4c4 commit 4f9db60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/if_vlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,9 +738,9 @@ static inline void vlan_remove_tag(struct sk_buff *skb, u16 *vlan_tci)
738738

739739
*vlan_tci = ntohs(vhdr->h_vlan_TCI);
740740

741-
memmove(skb->data + VLAN_HLEN, skb->data, 2 * ETH_ALEN);
742741
vlan_set_encap_proto(skb, vhdr);
743742
__skb_pull(skb, VLAN_HLEN);
743+
skb_postpull_data_move(skb, VLAN_HLEN, 2 * ETH_ALEN);
744744
}
745745

746746
/**

0 commit comments

Comments
 (0)