From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031014Ab2I1TRH (ORCPT ); Fri, 28 Sep 2012 15:17:07 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:45270 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759081Ab2I1TFQ (ORCPT ); Fri, 28 Sep 2012 15:05:16 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg KH , alan@lxorguk.ukuu.org.uk, =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= , Vinicius Costa Gomes , Gustavo Padovan Subject: =?UTF-8?q?=5B=20224/262=5D=20Bluetooth=3A=20Fix=20sending=20a=20HCI=20Authorization=20Request=20over=20LE=20links?= Date: Fri, 28 Sep 2012 11:52:33 -0700 Message-Id: <20120928183024.669697579@linuxfoundation.org> X-Mailer: git-send-email 1.7.10.1.362.g242cab3 In-Reply-To: <20120928182957.993484211@linuxfoundation.org> References: <20120928182957.993484211@linuxfoundation.org> User-Agent: quilt/0.60-2.1.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg KH 3.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vinicius Costa Gomes commit d8343f125710fb596f7a88cd756679f14f4e77b9 upstream. In the case that the link is already in the connected state and a Pairing request arrives from the mgmt interface, hci_conn_security() would be called but it was not considering LE links. Reported-by: João Paulo Rechi Vita Signed-off-by: Vinicius Costa Gomes Signed-off-by: Gustavo Padovan Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/hci_conn.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -42,6 +42,7 @@ #include #include +#include static void hci_le_connect(struct hci_conn *conn) { @@ -627,6 +628,9 @@ int hci_conn_security(struct hci_conn *c { BT_DBG("conn %p", conn); + if (conn->type == LE_LINK) + return smp_conn_security(conn, sec_level); + /* For sdp we don't need the link key. */ if (sec_level == BT_SECURITY_SDP) return 1;