summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2016-01-19 10:41:33 +0100
committerDavid S. Miller <davem@davemloft.net>2016-01-19 14:21:08 -0500
commit52a82e23b9f2a9e1d429c5207f8575784290d008 (patch)
treeec3563d6d1eea97c67e1014df4e4a037f7931b6d
parented0dfffd7dcd3f517b1507929642c2aed4ef00fb (diff)
af_iucv: Validate socket address length in iucv_sock_bind()
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Reported-by: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: Evgeny Cherkashin <Eugene.Crosser@ru.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/iucv/af_iucv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index ef50a94d3eb7..fc3598a922b0 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -708,6 +708,9 @@ static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
if (!addr || addr->sa_family != AF_IUCV)
return -EINVAL;
+ if (addr_len < sizeof(struct sockaddr_iucv))
+ return -EINVAL;
+
lock_sock(sk);
if (sk->sk_state != IUCV_OPEN) {
err = -EBADFD;