Skip to contentSkip to conversation

flow_dissector: Check skb for VLAN only if skb specified.

PATCH Superseded Eric Garver 1 participant 2 messages Oct 17, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 flow_dissector: Check skb for VLAN only if skb specified.

From: Eric Garver <[email protected]>

Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.

Fixes d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
---
 net/core/flow_dissector.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/core/flow_dissector.c +2 -4
index 1a7b80f73376..44e6ba9d3a6b 100644
@@ -247,12 +247,10 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
 	case htons(ETH_P_8021Q): {
 		const struct vlan_hdr *vlan;
 
-		if (skb_vlan_tag_present(skb))
+		if (skb && skb_vlan_tag_present(skb))
 			proto = skb->protocol;
 
-		if (!skb_vlan_tag_present(skb) ||
-		    proto == cpu_to_be16(ETH_P_8021Q) ||
-		    proto == cpu_to_be16(ETH_P_8021AD)) {
+		if (eth_type_vlan(proto)) {
 			struct vlan_hdr _vlan;
 
 			vlan = __skb_header_pointer(skb, nhoff, sizeof(_vlan),
Signature · 1 line
2.5.5
#1 lore raw
Quoted 6 lines · Eric Garver

From: Eric Garver <[email protected]>

Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.

Fixes d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")

Oops. Messed the From. Sending a v2.