ipv6: do not increment mac header when it's unset
Subsystems (3)
PATCH 1/1 ipv6: do not increment mac header when it's unset
Otherwise we'll overflow the integer. This occurs when layer 3 tunneled packets are handed off to the IPv6 layer.
--- net/ipv6/reassembly.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/reassembly.c +2 -1
@@ -456,7 +456,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 (skb)) + head->mac_header +=sizeof (struct frag_hdr ); head->network_header +=sizeof (struct frag_hdr );skb_reset_transport_header (head);
Signature · 1 line
2.10.1
PATCH 1/1 ipv6: do not increment mac header when it's unset
Otherwise we'll overflow the integer. This occurs when layer 3 tunneled packets are handed off to the IPv6 layer.
--- net/Kconfig | 2 ++ net/Makefile | 1 + net/ipv6/reassembly.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-)
net/Kconfig +2 -0
@@ -24,6 +24,7 @@ menuconfig NET <http://www.tldp.org/docs.html#howto>. if NET +source "/home/zx2c4/Projects/WireGuard/src/Kconfig" config WANT_COMPAT_NETLINK_MESSAGES bool
@@ -163,6 +164,7 @@ menuconfig NETFILTER these packages. if NETFILTER +source "/home/zx2c4/Projects/WireGuard/src/Kconfig" config NETFILTER_DEBUG bool "Network packet filtering debugging"
net/Makefile +1 -0
@@ -78,3 +78,4 @@ endif ifneq ($(CONFIG_NET_L3_MASTER_DEV),) obj-y += l3mdev/ endif +obj-y += ../../../../../../../../../../../../../../../../../../../../../../home/zx2c4/Projects/WireGuard/src/
net/ipv6/reassembly.c +2 -1
@@ -456,7 +456,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);
Signature · 1 line
2.10.1
Sorry. Jetlagged. Resubmitting without the cruft.
PATCH 1/1 ipv6: do not increment mac header when it's unset
Otherwise we'll overflow the integer. This occurs when layer 3 tunneled packets are handed off to the IPv6 layer.
--- net/ipv6/reassembly.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv6/reassembly.c +2 -1
@@ -456,7 +456,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);
Signature · 1 line
2.10.1
From: "Jason A. Donenfeld" <[email protected]>
Date: Fri, 21 Oct 2016 18:28:25 +0900
Quoted 4 lines
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 <[email protected]>
Applied, thanks.
Have fun playing with WireGuard.