aboutsummaryrefslogtreecommitdiff
path: root/net/compat.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2015-03-30 11:38:40 +0800
committerAlex Shi <alex.shi@linaro.org>2015-03-30 11:38:40 +0800
commit88720d8b842c59efcc0c4dc17e2107f4dae502f5 (patch)
tree967e60ace88cd9e4f9819042eedf3be6a445bb54 /net/compat.c
parentba0bfedf4c9cad58f56a7038d1462ffc21cd33df (diff)
parent73895725a9401bd3454757fcfa7d691270ac7498 (diff)
Merge tag 'v3.10.73' into linux-linaro-lskHEADlinux-linaro-lsk
This is the 3.10.73 stable release
Diffstat (limited to 'net/compat.c')
-rw-r--r--net/compat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/compat.c b/net/compat.c
index 275af79c131b..d12529050b29 100644
--- a/net/compat.c
+++ b/net/compat.c
@@ -71,6 +71,13 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg)
__get_user(kmsg->msg_controllen, &umsg->msg_controllen) ||
__get_user(kmsg->msg_flags, &umsg->msg_flags))
return -EFAULT;
+
+ if (!tmp1)
+ kmsg->msg_namelen = 0;
+
+ if (kmsg->msg_namelen < 0)
+ return -EINVAL;
+
if (kmsg->msg_namelen > sizeof(struct sockaddr_storage))
kmsg->msg_namelen = sizeof(struct sockaddr_storage);
kmsg->msg_name = compat_ptr(tmp1);