Skip to content

net: fix skb->protocol not updated after VLAN network header adjustment

[email protected] bpf imx lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2net: packet: fix skb->protocol not updated after VLAN network header adjustmentnet/packet/af_packet.c+9 -30 replies
2/2net: tap: fix skb->protocol not updated after VLAN network header adjustmentdrivers/net/tap.c+9 -35 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/2] net: fix skb->protocol not updated after VLAN network header adjustment

From: Wei Fang <[email protected]>

After calling skb_set_network_header() to skip past the VLAN tag, skb->protocol still points to the outer VLAN EtherType. If skb_probe_transport_header() is then called without updating skb->protocol to the inner protocol, the flow dissector will misparse the inner header as a VLAN header and fail to set transport_header, leaving it at its uninitialized sentinel value (~0U).

This series fixes two instances of this bug in packet_parse_headers() and tap_get_user_xdp() by assigning the return value of vlan_get_protocol_and_depth() to skb->protocol after skb_set_network_header().

Wei Fang (2):
net: packet: fix skb->protocol not updated after VLAN network header
adjustment
net: tap: fix skb->protocol not updated after VLAN network header
adjustment

 drivers/net/tap.c      | 12 +++++++++---
 net/packet/af_packet.c | 12 +++++++++---
 2 files changed, 18 insertions(+), 6 deletions(-)
Signature · 1 line
2.34.1