]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - net/socket.c
net: Cap number of elements for sendmmsg
[mirror_ubuntu-zesty-kernel.git] / net / socket.c
index e4ed2359eb43db5277503c9a623d1b2f560c1624..b5c6de4f268a170423de9542299a184d980b984c 100644 (file)
@@ -1999,6 +1999,9 @@ int __sys_sendmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
        struct compat_mmsghdr __user *compat_entry;
        struct msghdr msg_sys;
 
+       if (vlen > UIO_MAXIOV)
+               vlen = UIO_MAXIOV;
+
        datagrams = 0;
 
        sock = sockfd_lookup_light(fd, &err, &fput_needed);