aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/icmp.c3
-rw-r--r--net/ipv6/icmp.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index a7321a82df6..a13c074dac0 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1015,7 +1015,8 @@ int icmp_rcv(struct sk_buff *skb)
goto error;
}
- __skb_pull(skb, sizeof(*icmph));
+ if (!pskb_pull(skb, sizeof(*icmph)))
+ goto error;
icmph = icmp_hdr(skb);
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index cbb5b9cf84a..121d517bf91 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -683,7 +683,8 @@ static int icmpv6_rcv(struct sk_buff *skb)
}
}
- __skb_pull(skb, sizeof(*hdr));
+ if (!pskb_pull(skb, sizeof(*hdr)))
+ goto discard_it;
hdr = icmp6_hdr(skb);