From: Ursula Braun Date: Tue, 19 Jan 2016 09:41:33 +0000 (+0100) Subject: af_iucv: Validate socket address length in iucv_sock_bind() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=52a82e23b9f2a9e1d429c5207f8575784290d008;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git af_iucv: Validate socket address length in iucv_sock_bind() Signed-off-by: Ursula Braun Reported-by: Dmitry Vyukov Reviewed-by: Evgeny Cherkashin Signed-off-by: David S. Miller --- 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;