netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Georg Kohmann <geokohma@cisco.com>
To: netdev@vger.kernel.org
Cc: Georg Kohmann <geokohma@cisco.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH 4.4 stable 03/10] ipv6: do not increment mac header when it's unset
Date: Tue,  8 Oct 2019 13:23:02 +0200	[thread overview]
Message-ID: <20191008112309.9571-4-geokohma@cisco.com> (raw)
In-Reply-To: <20191008112309.9571-1-geokohma@cisco.com>

commit b678aa578c9e ("ipv6: do not increment mac header when it's unset")
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Fri Oct 21 18:28:25 2016 +0900

Otherwise we'll overflow the integer. This occurs when layer 3 tunneled
packets are handed off to the IPv6 layer.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 net/ipv6/reassembly.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index ec917f5..2842ccf 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -418,7 +418,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
 	skb_network_header(head)[nhoff] = skb_transport_header(head)[0];
 	memmove(head->head + sizeof(struct frag_hdr), head->head,
 		(head->data - head->head) - sizeof(struct frag_hdr));
-	head->mac_header += sizeof(struct frag_hdr);
+	if (skb_mac_header_was_set(head))
+		head->mac_header += sizeof(struct frag_hdr);
 	head->network_header += sizeof(struct frag_hdr);
 
 	skb_reset_transport_header(head);
-- 
2.10.2


  parent reply	other threads:[~2019-10-08 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 11:22 [PATCH 4.4 stable 00/10] net: ip6 defrag: backport fixes Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 01/10] netfilter: ipv6: nf_defrag: avoid/free clone operations Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 02/10] netfilter: ipv6: avoid nf_iterate recursion Georg Kohmann
2019-10-08 11:23 ` Georg Kohmann [this message]
2019-10-08 11:23 ` [PATCH 4.4 stable 04/10] netfilter: ipv6: nf_defrag: Pass on packets to stack per RFC2460 Georg Kohmann
2019-10-08 12:04   ` Greg Kroah-Hartman
2019-10-08 11:23 ` [PATCH 4.4 stable 05/10] netfilter: ipv6: nf_defrag: fix NULL deref panic Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 06/10] ipv6: frags: fix a lockdep false positive Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 07/10] net: IP defrag: encapsulate rbtree defrag code into callable functions Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 08/10] ipv6: remove dependency of nf_defrag_ipv6 on ipv6 module Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 09/10] net: IP6 defrag: use rbtrees for IPv6 defrag Georg Kohmann
2019-10-08 11:23 ` [PATCH 4.4 stable 10/10] net: IP6 defrag: use rbtrees in nf_conntrack_reasm.c Georg Kohmann
2020-02-05  3:40 ` [PATCH 4.4 stable 00/10] net: ip6 defrag: backport fixes Nobuhiro Iwamatsu

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=20191008112309.9571-4-geokohma@cisco.com \
    --to=geokohma@cisco.com \
    --cc=Jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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).