netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Machata <petrm@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru,
	yoshfuji@linux-ipv6.org, u9012063@gmail.com, xeb@mail.ru
Subject: [PATCH net 0/7] net: ip6_gre: Fixes in headroom handling
Date: Thu, 17 May 2018 16:36:04 +0200	[thread overview]
Message-ID: <cover.1526567568.git.petrm@mellanox.com> (raw)

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

-- 
2.4.11

             reply	other threads:[~2018-05-17 14:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 14:36 Petr Machata [this message]
2018-05-17 14:36 ` [PATCH net 1/7] net: ip6_gre: Request headroom in __gre6_xmit() Petr Machata
2018-05-17 19:32   ` William Tu
2018-05-17 20:43   ` Petr Machata
2018-05-17 14:36 ` [PATCH net 2/7] net: ip6_gre: Fix headroom request in ip6erspan_tunnel_xmit() Petr Machata
2018-05-17 19:34   ` William Tu
2018-05-17 20:44   ` Petr Machata
2018-05-17 14:36 ` [PATCH net 3/7] net: ip6_gre: Split up ip6gre_tnl_link_config() Petr Machata
2018-05-17 19:45   ` William Tu
2018-05-17 20:45   ` Petr Machata
2018-05-17 14:36 ` [PATCH net 4/7] net: ip6_gre: Split up ip6gre_tnl_change() Petr Machata
2018-05-17 19:45   ` William Tu
2018-05-17 20:45   ` Petr Machata
2018-05-17 14:36 ` [PATCH net 5/7] net: ip6_gre: Split up ip6gre_newlink() Petr Machata
2018-05-17 19:48   ` William Tu
2018-05-17 20:46   ` Petr Machata
2018-05-17 14:36 ` [PATCH net 6/7] net: ip6_gre: Split up ip6gre_changelink() Petr Machata
2018-05-17 19:48   ` William Tu
2018-05-17 20:46   ` Petr Machata
2018-05-17 14:36 ` [PATCH net 7/7] net: ip6_gre: Fix ip6erspan hlen calculation Petr Machata
2018-05-17 19:52   ` William Tu
2018-05-17 20:47   ` Petr Machata
2018-05-17 20:42 ` [PATCH net 0/7] net: ip6_gre: Fixes in headroom handling David Miller
2018-05-17 21:03   ` Petr Machata
2018-05-17 21:18     ` David Miller
2018-05-17 21:53       ` Petr Machata

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1526567568.git.petrm@mellanox.com \
    --to=petrm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@vger.kernel.org \
    --cc=u9012063@gmail.com \
    --cc=xeb@mail.ru \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).