diff options
author | Yossi Kuperman <yossiku@mellanox.com> | 2017-06-22 04:37:10 -0400 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2017-06-22 04:49:14 -0400 |
commit | 7c88e21aefcf86fb41b48b2e04528db5a30fbe18 (patch) | |
tree | 7f7023cf174ea4739b7195e641bdaead99e66f8a | |
parent | e747f64336fc15e1c823344942923195b800aa1e (diff) |
xfrm6: Fix IPv6 payload_len in xfrm6_transport_finish
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>
-rw-r--r-- | net/ipv6/xfrm6_input.c | 2 |
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) | |||
43 | return 1; | 43 | return 1; |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | ipv6_hdr(skb)->payload_len = htons(skb->len); | ||
47 | __skb_push(skb, skb->data - skb_network_header(skb)); | 46 | __skb_push(skb, skb->data - skb_network_header(skb)); |
47 | ipv6_hdr(skb)->payload_len = htons(skb->len - sizeof(struct ipv6hdr)); | ||
48 | 48 | ||
49 | if (xo && (xo->flags & XFRM_GRO)) { | 49 | if (xo && (xo->flags & XFRM_GRO)) { |
50 | skb_mac_header_rebuild(skb); | 50 | skb_mac_header_rebuild(skb); |