Skip to content

tunnels: fix incorrect IPv4/v6 headers interpretation

Jiri Benc netdev 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 9 repliesIn review
  2. v14 patches 6 repliesSuperseded

Changelog from the cover letter

v2: fixed geneve after incorrect rebase on top of Pravin's patches

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4ip_tunnels: convert the mode field of ip_tunnel_info to flagsdrivers/net/geneve.c drivers/net/vxlan.c include/net/dst_metadata.h +4 more+7 -132 replies
2/4ip_tunnels: record IP version in tunnel infodrivers/net/geneve.c drivers/net/vxlan.c include/net/dst_metadata.h +6 more+24 -23 replies
3/4fou: reject IPv6 confignet/ipv4/fou.c+1 -10 replies
4/4vxlan: do not receive IPv4 packets on IPv6 socketdrivers/net/vxlan.c include/net/udp_tunnel.h net/ipv6/ip6_udp_tunnel.c+12 -13 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchAlexei StarovoitovThomas GrafPravin B Shelar
1/4A-b A-b A-b
2/4A-b A-b A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/4] tunnels: fix incorrect IPv4/v6 headers interpretation

With tunneling, it is currently possible to get an IPv6 header and interpret it as an IPv4 header, or to interpret an IPv6 address as an IPv4 address (and vice versa). This leads to things like sending packets to incorrect address, IPv6 flow label being interpreted as IP packet length, etc.

Fix several places where this can happen.

Most of this is net-next only. The third patch affects net, too, but it doesn't seem there's anything in user space that sets the attribute at all currently, thus net-next is fine.

Changelog:
v2: fixed geneve after incorrect rebase on top of Pravin's patches

Jiri Benc (4):
ip_tunnels: convert the mode field of ip_tunnel_info to flags
ip_tunnels: record IP version in tunnel info
fou: reject IPv6 config
vxlan: do not receive IPv4 packets on IPv6 socket

 drivers/net/geneve.c       |  4 +++-
 drivers/net/vxlan.c        |  5 ++++-
 include/net/dst_metadata.h |  2 +-
 include/net/ip_tunnels.h   | 19 ++++++++++++-------
 include/net/udp_tunnel.h   |  3 ++-
 net/core/filter.c          |  2 ++
 net/ipv4/fou.c             |  2 +-
 net/ipv4/ip_gre.c          |  3 ++-
 net/ipv4/ip_tunnel_core.c  |  2 +-
 net/ipv4/route.c           |  2 +-
 net/ipv6/ip6_udp_tunnel.c  |  9 +++++++++
 net/ipv6/route.c           |  2 +-
 net/openvswitch/flow.c     |  2 ++
 net/openvswitch/vport.c    |  2 ++
 14 files changed, 43 insertions(+), 16 deletions(-)
Signature · 1 line
1.8.3.1