summaryrefslogtreecommitdiff
path: root/net/iucv/af_iucv.c
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2016-01-19 12:41:33 +0300
committerJiri Slaby <jslaby@suse.cz>2016-03-02 13:46:31 +0300
commit28103f2f1fb676a2b305ed6e15f83a8a84906d45 (patch)
tree542c5f52478ec0f98af4c5c6642723c81dccd73f /net/iucv/af_iucv.c
parent6308e3add5288c1eb1b7ee2654d9a251cc487ab2 (diff)
downloadlinux-28103f2f1fb676a2b305ed6e15f83a8a84906d45.tar.xz
af_iucv: Validate socket address length in iucv_sock_bind()
[ Upstream commit 52a82e23b9f2a9e1d429c5207f8575784290d008 ] 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> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'net/iucv/af_iucv.c')
-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 1465363a452b..bb3969a40b8e 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -697,6 +697,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;