Skip to contentSkip to conversation

Bluetooth: Ignore IRKs with no Identity Address

PATCH In review [email protected] 2 participants 2 messages Feb 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Ignore IRKs with no Identity Address

From: Johan Hedberg <[email protected]>

The Core Specification (4.1) leaves room for sending an SMP Identity Address Information PDU with an all-zeros BD_ADDR value. This essentially means that we would not have an Identity Address for the device and the only means of identifying it would be the IRK value itself.

Due to lack of any known implementations behaving like this it's best to keep our implementation as simple as possible as far as handling such situations is concerned. This patch updates the Identity Address Information handler function to simply ignore the IRK received from such a device.

---
 net/bluetooth/smp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
net/bluetooth/smp.c +13 -0
index 79a80f44c832..50355d045992 100644
@@ -1003,6 +1003,19 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
 
 	skb_pull(skb, sizeof(*info));
 
+	/* Strictly speaking the Core Specification (4.1) allows sending
+	 * an empty address which would force us to rely on just the IRK
+	 * as "identity information". However, since such
+	 * implementations are not known of and in order to not over
+	 * complicate our implementation, simply pretend that we never
+	 * received an IRK for such a device.
+	 */
+	if (!bacmp(&info->bdaddr, BDADDR_ANY)) {
+		BT_ERR("Ignoring IRK with no identity address");
+		smp_distribute_keys(conn, 1);
+		return 0;
+	}
+
 	bacpy(&smp->id_addr, &info->bdaddr);
 	smp->id_addr_type = info->addr_type;
 
Signature · 1 line
1.8.5.3
maintainer
#1 lore raw

Hi Johan,

Quoted 12 lines

The Core Specification (4.1) leaves room for sending an SMP Identity Address Information PDU with an all-zeros BD_ADDR value. This essentially means that we would not have an Identity Address for the device and the only means of identifying it would be the IRK value itself.

Due to lack of any known implementations behaving like this it's best to keep our implementation as simple as possible as far as handling such situations is concerned. This patch updates the Identity Address Information handler function to simply ignore the IRK received from such a device.

Quoted 4 lines

---
net/bluetooth/smp.c | 13 +++++++++++++

1 file changed, 13 insertions(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel