Skip to content

net: ip6_gre: Fixes in headroom handling

Petr Machata netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7net: ip6_gre: Request headroom in __gre6_xmit()net/ipv6/ip6_gre.c+3 -02 replies
2/7net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit()net/ipv6/ip6_gre.c+1 -12 replies
3/7net: ip6_gre: Split up ip6gre_tnl_link_config()net/ipv6/ip6_gre.c+26 -122 replies
4/7net: ip6_gre: Split up ip6gre_tnl_change()net/ipv6/ip6_gre.c+8 -22 replies
5/7net: ip6_gre: Split up ip6gre_newlink()net/ipv6/ip6_gre.c+18 -62 replies
6/7net: ip6_gre: Split up ip6gre_changelink()net/ipv6/ip6_gre.c+24 -92 replies
7/7net: ip6_gre: Fix ip6erspan hlen calculationnet/ipv6/ip6_gre.c+65 -92 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchWilliam Tu
1/7A-b
2/7A-b
3/7A-b
4/7A-b
5/7A-b
6/7A-b
7/7A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net 0/7] net: ip6_gre: Fixes in headroom handling

This series mends some problems in headroom management in ip6_gre module. The current code base has the following three closely-related problems:

- ip6gretap tunnels neglect to ensure there's enough writable headroom before pushing GRE headers.

- ip6erspan does this, but assumes that dev->needed_headroom is primed. But that doesn't happen until ip6_tnl_xmit() is called later. Thus for the first packet, ip6erspan actually behaves like ip6gretap above.

- ip6erspan shares some of the code with ip6gretap, including calculations of needed header length. While there is custom ERSPAN-specific code for calculating the headroom, the computed values are overwritten by the ip6gretap code.

The first two issues lead to a kernel panic in situations where a packet is mirrored from a veth device to the device in question. They are fixed, respectively, in patches #1 and #2, which include the full panic trace and a reproducer.

The rest of the patchset deals with the last issue. In patches #3 to #6, several functions are split up into reusable parts. Finally in patch #7 these blocks are used to compose ERSPAN-specific callbacks where necessary to fix the hlen calculation.

Petr Machata (7):
net: ip6_gre: Request headroom in __gre6_xmit()
net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit()
net: ip6_gre: Split up ip6gre_tnl_link_config()
net: ip6_gre: Split up ip6gre_tnl_change()
net: ip6_gre: Split up ip6gre_newlink()
net: ip6_gre: Split up ip6gre_changelink()
net: ip6_gre: Fix ip6erspan hlen calculation

 net/ipv6/ip6_gre.c | 184 +++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 145 insertions(+), 39 deletions(-)
Signature · 1 line
2.4.11