summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYossi Kuperman <yossiku@mellanox.com>2017-06-22 11:37:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-05 14:41:40 +0200
commit4d03c6171114ed45d1267cf5d0f49d832de1e917 (patch)
tree1efa0e9c6c14a338972f184b854b19a3d827795f /net
parentc4ed418dc93b6d44b21acc3dbe060ac1be921b79 (diff)
downloadlinux-stable-4d03c6171114ed45d1267cf5d0f49d832de1e917.tar.gz
linux-stable-4d03c6171114ed45d1267cf5d0f49d832de1e917.tar.bz2
linux-stable-4d03c6171114ed45d1267cf5d0f49d832de1e917.zip
xfrm6: Fix IPv6 payload_len in xfrm6_transport_finish
commit 7c88e21aefcf86fb41b48b2e04528db5a30fbe18 upstream. IPv6 payload length indicates the size of the payload, including any extension headers. In xfrm6_transport_finish, ipv6_hdr(skb)->payload_len is set to the payload size only, regardless of the presence of any extension headers. After ESP GRO transport mode decapsulation, ipv6_rcv trims the packet according to the wrong payload_len, thus corrupting the packet. Set payload_len to account for extension headers as well. Fixes: 7785bba299a8 ("esp: Add a software GRO codepath") Signed-off-by: Yossi Kuperman <yossiku@mellanox.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/xfrm6_input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index 08a807b29298..3ef5d913e7a3 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -43,8 +43,8 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async)
return 1;
#endif
- ipv6_hdr(skb)->payload_len = htons(skb->len);
__skb_push(skb, skb->data - skb_network_header(skb));
+ ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr));
if (xo && (xo->flags & XFRM_GRO)) {
skb_mac_header_rebuild(skb);