diff options
-rw-r--r-- | net/ipv4/fou.c | 4 | ||||
-rw-r--r-- | net/ipv6/fou6.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c index 437070d1ffb1..79e98e21cdd7 100644 --- a/net/ipv4/fou.c +++ b/net/ipv4/fou.c | |||
@@ -1024,7 +1024,7 @@ static int gue_err(struct sk_buff *skb, u32 info) | |||
1024 | int ret; | 1024 | int ret; |
1025 | 1025 | ||
1026 | len = sizeof(struct udphdr) + sizeof(struct guehdr); | 1026 | len = sizeof(struct udphdr) + sizeof(struct guehdr); |
1027 | if (!pskb_may_pull(skb, len)) | 1027 | if (!pskb_may_pull(skb, transport_offset + len)) |
1028 | return -EINVAL; | 1028 | return -EINVAL; |
1029 | 1029 | ||
1030 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; | 1030 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; |
@@ -1059,7 +1059,7 @@ static int gue_err(struct sk_buff *skb, u32 info) | |||
1059 | 1059 | ||
1060 | optlen = guehdr->hlen << 2; | 1060 | optlen = guehdr->hlen << 2; |
1061 | 1061 | ||
1062 | if (!pskb_may_pull(skb, len + optlen)) | 1062 | if (!pskb_may_pull(skb, transport_offset + len + optlen)) |
1063 | return -EINVAL; | 1063 | return -EINVAL; |
1064 | 1064 | ||
1065 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; | 1065 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; |
diff --git a/net/ipv6/fou6.c b/net/ipv6/fou6.c index 867474abe269..ec4e2ed95f36 100644 --- a/net/ipv6/fou6.c +++ b/net/ipv6/fou6.c | |||
@@ -94,7 +94,7 @@ static int gue6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
94 | int ret; | 94 | int ret; |
95 | 95 | ||
96 | len = sizeof(struct udphdr) + sizeof(struct guehdr); | 96 | len = sizeof(struct udphdr) + sizeof(struct guehdr); |
97 | if (!pskb_may_pull(skb, len)) | 97 | if (!pskb_may_pull(skb, transport_offset + len)) |
98 | return -EINVAL; | 98 | return -EINVAL; |
99 | 99 | ||
100 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; | 100 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; |
@@ -129,7 +129,7 @@ static int gue6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
129 | 129 | ||
130 | optlen = guehdr->hlen << 2; | 130 | optlen = guehdr->hlen << 2; |
131 | 131 | ||
132 | if (!pskb_may_pull(skb, len + optlen)) | 132 | if (!pskb_may_pull(skb, transport_offset + len + optlen)) |
133 | return -EINVAL; | 133 | return -EINVAL; |
134 | 134 | ||
135 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; | 135 | guehdr = (struct guehdr *)&udp_hdr(skb)[1]; |