[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191008112309.9571-4-geokohma@cisco.com>
Date: Tue, 8 Oct 2019 13:23:02 +0200
From: Georg Kohmann <geokohma@...co.com>
To: netdev@...r.kernel.org
Cc: Georg Kohmann <geokohma@...co.com>,
"Jason A . Donenfeld" <Jason@...c4.com>,
"David S . Miller" <davem@...emloft.net>
Subject: [PATCH 4.4 stable 03/10] ipv6: do not increment mac header when it's unset
commit b678aa578c9e ("ipv6: do not increment mac header when it's unset")
Author: Jason A. Donenfeld <Jason@...c4.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@...c4.com>
Signed-off-by: David S. Miller <davem@...emloft.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
Powered by blists - more mailing lists