diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2016-01-19 10:41:33 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2016-05-01 00:05:25 +0200 |
commit | d942c7354aa7b406403c42ad946157448a9157f3 (patch) | |
tree | 8dc05e263d5a659fc64a35e6d1ee1af974d16db1 | |
parent | 58b45f408a8821b6d9f0003c3fdfa179145c90e7 (diff) | |
download | linux-stable-d942c7354aa7b406403c42ad946157448a9157f3.tar.gz linux-stable-d942c7354aa7b406403c42ad946157448a9157f3.tar.bz2 linux-stable-d942c7354aa7b406403c42ad946157448a9157f3.zip |
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: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | net/iucv/af_iucv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index cf98d625d958..fc36accd487d 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; |