Skip to contentSkip to conversation

Patch "ipv6: Set skb->protocol properly for local output" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Dec 9, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

    ipv6: Set skb->protocol properly for local output

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ipv6-set-skb-protocol-properly-for-local-output.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b4e479a96fc398ccf83bb1cffb4ffef8631beaf1 Mon Sep 17 00:00:00 2001

From: Eli Cooper <[email protected]>
Date: Thu, 1 Dec 2016 10:05:11 +0800
Subject: ipv6: Set skb->protocol properly for local output

From: Eli Cooper <[email protected]>

commit b4e479a96fc398ccf83bb1cffb4ffef8631beaf1 upstream.

When xfrm is applied to TSO/GSO packets, it follows this path:

    xfrm_output() -> xfrm_output_gso() -> skb_gso_segment()

where skb_gso_segment() relies on skb->protocol to function properly.

This patch sets skb->protocol to ETH_P_IPV6 before dst_output() is called, fixing a bug where GSO packets sent through an ipip6 tunnel are dropped when xfrm is involved.

---
 net/ipv6/output_core.c |    2 ++
 1 file changed, 2 insertions(+)
net/ipv6/output_core.c +2 -0
@@ -148,6 +148,8 @@ int __ip6_local_out(struct net *net, str
 	ipv6_hdr(skb)->payload_len = htons(len);
 	IP6CB(skb)->nhoff = offsetof(struct ipv6hdr, nexthdr);
 
+	skb->protocol = htons(ETH_P_IPV6);
+
 	return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT,
 		       net, sk, skb, NULL, skb_dst(skb)->dev,
 		       dst_output);

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/ipv6-set-skb-protocol-properly-for-local-output.patch queue-4.8/ipv4-set-skb-protocol-properly-for-local-output.patch queue-4.8/revert-ip6_tunnel-update-skb-protocol-to-eth_p_ipv6-in-ip6_tnl_xmit.patch