mirror of
https://github.com/torvalds/linux.git
synced 2026-11-25 16:02:57 +00:00
af_iucv: Validate socket address length in iucv_sock_bind()
Signed-off-by: Ursula Braun <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Reviewed-by: Evgeny Cherkashin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
committed by
David S. Miller
parent
ed0dfffd7d
commit
52a82e23b9
@@ -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