BPF List
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: fix skb->protocol not updated after VLAN network header adjustment
@ 2026-08-05 10:53 wei.fang
  2026-08-05 10:53 ` [PATCH net 1/2] net: packet: " wei.fang
  2026-08-05 10:53 ` [PATCH net 2/2] net: tap: " wei.fang
  0 siblings, 2 replies; 10+ messages in thread
From: wei.fang @ 2026-08-05 10:53 UTC (permalink / raw)
  To: willemdebruijn.kernel, davem, edumazet, kuba, pabeni, horms,
	liuhangbin, mst, jasowangio, andrew+netdev, ast, daniel, hawk,
	john.fastabend, sdf
  Cc: wei.fang, imx, netdev, linux-kernel, bpf

From: Wei Fang <wei.fang@nxp.com>

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-07  2:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 10:53 [PATCH net 0/2] net: fix skb->protocol not updated after VLAN network header adjustment wei.fang
2026-08-05 10:53 ` [PATCH net 1/2] net: packet: " wei.fang
2026-08-06 10:49   ` sashiko-bot
2026-08-05 10:53 ` [PATCH net 2/2] net: tap: " wei.fang
2026-08-05 12:48   ` Willem de Bruijn
2026-08-06  2:10     ` Wei Fang
2026-08-06 10:06       ` Wei Fang
2026-08-06 14:12         ` Willem de Bruijn
2026-08-07  2:21           ` Wei Fang
2026-08-06 10:49   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox