summaryrefslogtreecommitdiff
path: root/net/ipv4/ping.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-12-12 22:17:37 +0800
committerAlex Shi <alex.shi@linaro.org>2016-12-12 22:17:37 +0800
commit2f0de5192ae332ff270b2fc30594e4d67002d59b (patch)
tree475fcbdaf94fdc1bc32c1527d448f702d5c18770 /net/ipv4/ping.c
parentbdcf7d8df4cfa7f99423da161019b964f7ce2520 (diff)
parenta057484ab40ff81f22a94bb62c035c78b5abd940 (diff)
Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 0d5278ca4777..cd2cf3515c66 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -660,6 +660,10 @@ int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
if (len > 0xFFFF)
return -EMSGSIZE;
+ /* Must have at least a full ICMP header. */
+ if (len < icmph_len)
+ return -EINVAL;
+
/*
* Check the flags.
*/