Thread (5 messages) flat view 5 messages, 4 authors, 7d ago

Re: [PATCH net] vlan: require the MAC header to be present in __vlan_insert_inner_tag()

From: Jakub Kicinski <kuba@kernel.org>
Date: 2026-09-19 22:49:13
Also in: bpf, lkml, stable

On Sat, 19 Sep 2026 08:45:35 +0100 Simon Horman wrote:
quoted
+	if (unlikely(!pskb_may_pull(skb, mac_len)))
+		return -EINVAL;
+
 	if (skb_cow_head(skb, meta_len + VLAN_HLEN) < 0)
 		return -ENOMEM;  
TBH I am surprised that we have a bug like this in this function.
But your analysis matches my understanding of the code.
FWIW I suspect it's because non-ethernet packets shouldn't normally
reach ethernet helpers. But I'm not sure how practical it would be
to push mac_len checks to the callers or anything of the sort,
so we can as well check here..
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help