From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964960AbcATWGI (ORCPT ); Wed, 20 Jan 2016 17:06:08 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40269 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934841AbcATWBq (ORCPT ); Wed, 20 Jan 2016 17:01:46 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "David S. Miller" Subject: [PATCH 3.14 42/47] bluetooth: Validate socket address length in sco_sock_bind(). Date: Wed, 20 Jan 2016 14:01:14 -0800 Message-Id: <20160120215513.917809800@linuxfoundation.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <20160120215507.575738941@linuxfoundation.org> References: <20160120215507.575738941@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: "David S. Miller" [ Upstream commit 5233252fce714053f0151680933571a2da9cbfb4 ] Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/sco.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -459,6 +459,9 @@ static int sco_sock_bind(struct socket * if (!addr || addr->sa_family != AF_BLUETOOTH) return -EINVAL; + if (addr_len < sizeof(struct sockaddr_sco)) + return -EINVAL; + lock_sock(sk); if (sk->sk_state != BT_OPEN) {