Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix incorrectly overriding conn->src_type
@ 2014-06-05  8:54 johan.hedberg
  2014-06-05  9:19 ` [PATCH v2] " johan.hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: johan.hedberg @ 2014-06-05  8:54 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

The src_type member of struct hci_conn should always reflect the address
type of the src_member. It should never be overridden. There is already
code in place in the command status handler of HCI_LE_Create_Connection
to copy the right initiator address into conn->init_addr_type.

Without this patch, if privacy is enable, e.g. disconnection events to
user space will contain the identity address by the wrong address type
(e.g. public address with random address type).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/hci_conn.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 1bb8900086dd..7430001570d9 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -610,11 +610,6 @@ static void hci_req_add_le_create_conn(struct hci_request *req,
 	if (hci_update_random_address(req, false, &own_addr_type))
 		return;
 
-	/* Save the address type used for this connnection attempt so we able
-	 * to retrieve this information if we need it.
-	 */
-	conn->src_type = own_addr_type;
-
 	cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
 	cp.scan_window = cpu_to_le16(hdev->le_scan_window);
 	bacpy(&cp.peer_addr, &conn->dst);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2] Bluetooth: Fix incorrectly overriding conn->src_type
  2014-06-05  8:54 [PATCH] Bluetooth: Fix incorrectly overriding conn->src_type johan.hedberg
@ 2014-06-05  9:19 ` johan.hedberg
  2014-06-05  9:56   ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: johan.hedberg @ 2014-06-05  9:19 UTC (permalink / raw)
  To: linux-bluetooth

From: Johan Hedberg <johan.hedberg@intel.com>

The src_type member of struct hci_conn should always reflect the address
type of the src_member. It should never be overridden. There is already
code in place in the command status handler of HCI_LE_Create_Connection
to copy the right initiator address into conn->init_addr_type.

Without this patch, if privacy is enabled, we will send the wrong
address type in the SMP identity address information PDU (it'll e.g.
contain our public address but a random address type).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
v2: Reworded misleading commit message

 net/bluetooth/hci_conn.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 1bb8900086dd..7430001570d9 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -610,11 +610,6 @@ static void hci_req_add_le_create_conn(struct hci_request *req,
 	if (hci_update_random_address(req, false, &own_addr_type))
 		return;
 
-	/* Save the address type used for this connnection attempt so we able
-	 * to retrieve this information if we need it.
-	 */
-	conn->src_type = own_addr_type;
-
 	cp.scan_interval = cpu_to_le16(hdev->le_scan_interval);
 	cp.scan_window = cpu_to_le16(hdev->le_scan_window);
 	bacpy(&cp.peer_addr, &conn->dst);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Bluetooth: Fix incorrectly overriding conn->src_type
  2014-06-05  9:19 ` [PATCH v2] " johan.hedberg
@ 2014-06-05  9:56   ` Marcel Holtmann
  0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2014-06-05  9:56 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth

Hi Johan,

> The src_type member of struct hci_conn should always reflect the address
> type of the src_member. It should never be overridden. There is already
> code in place in the command status handler of HCI_LE_Create_Connection
> to copy the right initiator address into conn->init_addr_type.
> 
> Without this patch, if privacy is enabled, we will send the wrong
> address type in the SMP identity address information PDU (it'll e.g.
> contain our public address but a random address type).
> 
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> v2: Reworded misleading commit message
> 
> net/bluetooth/hci_conn.c | 5 -----
> 1 file changed, 5 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-05  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05  8:54 [PATCH] Bluetooth: Fix incorrectly overriding conn->src_type johan.hedberg
2014-06-05  9:19 ` [PATCH v2] " johan.hedberg
2014-06-05  9:56   ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox