Commit 28103f2f authored by Ursula Braun's avatar Ursula Braun Committed by Jiri Slaby

af_iucv: Validate socket address length in iucv_sock_bind()

[ Upstream commit 52a82e23 ]
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
Reviewed-by: default avatarEvgeny Cherkashin <Eugene.Crosser@ru.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 6308e3ad
...@@ -697,6 +697,9 @@ static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr, ...@@ -697,6 +697,9 @@ static int iucv_sock_bind(struct socket *sock, struct sockaddr *addr,
if (!addr || addr->sa_family != AF_IUCV) if (!addr || addr->sa_family != AF_IUCV)
return -EINVAL; return -EINVAL;
if (addr_len < sizeof(struct sockaddr_iucv))
return -EINVAL;
lock_sock(sk); lock_sock(sk);
if (sk->sk_state != IUCV_OPEN) { if (sk->sk_state != IUCV_OPEN) {
err = -EBADFD; err = -EBADFD;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment