diff options
-rw-r--r-- | net/tipc/socket.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 893ca6eb5b41..125dcb0737b2 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -493,6 +493,8 @@ static int dest_name_check(struct sockaddr_tipc *dest, struct msghdr *m) | |||
493 | if (likely(dest->addr.name.name.type != TIPC_CFG_SRV)) | 493 | if (likely(dest->addr.name.name.type != TIPC_CFG_SRV)) |
494 | return -EACCES; | 494 | return -EACCES; |
495 | 495 | ||
496 | if (!m->msg_iovlen || (m->msg_iov[0].iov_len < sizeof(hdr))) | ||
497 | return -EMSGSIZE; | ||
496 | if (copy_from_user(&hdr, m->msg_iov[0].iov_base, sizeof(hdr))) | 498 | if (copy_from_user(&hdr, m->msg_iov[0].iov_base, sizeof(hdr))) |
497 | return -EFAULT; | 499 | return -EFAULT; |
498 | if ((ntohs(hdr.tcm_type) & 0xC000) && (!capable(CAP_NET_ADMIN))) | 500 | if ((ntohs(hdr.tcm_type) & 0xC000) && (!capable(CAP_NET_ADMIN))) |