mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
af_iucv: Validate socket address length in iucv_sock_bind()
[ Upstream commit 52a82e23b9 ]
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2134d97aa3
commit
626a83d5d5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user