Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759441AbcCVLLi (ORCPT ); Tue, 22 Mar 2016 07:11:38 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56629 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758743AbcCVKmP (ORCPT ); Tue, 22 Mar 2016 06:42:15 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Ursula Braun , "David S. Miller" , Luis Henriques Subject: [PATCH 3.16.y-ckt 058/142] af_iucv: Validate socket address length in iucv_sock_bind() Date: Tue, 22 Mar 2016 10:39:47 +0000 Message-Id: <1458643271-4227-59-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> References: <1458643271-4227-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 31 3.16.7-ckt26 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Ursula Braun commit 52a82e23b9f2a9e1d429c5207f8575784290d008 upstream. Signed-off-by: Ursula Braun Reported-by: Dmitry Vyukov Reviewed-by: Evgeny Cherkashin Signed-off-by: David S. Miller Signed-off-by: Luis Henriques --- net/iucv/af_iucv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index 7a95fa4a3de1..f521848e26c7 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c @@ -709,6 +709,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;