[PATCH 3.18 003/151] Bluetooth: Fix valid Identity Address check

2015-03-03 Thread Greg Kroah-Hartman
3.18-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hedberg 

commit e12af489b91d47a806f4e96e4edc20df612482e7 upstream.

According to the Bluetooth core specification valid identity addresses
are either Public Device Addresses or Static Random Addresses. IRKs
received with any other type of address should be discarded since we
cannot assume to know the permanent identity of the peer device.

This patch fixes a missing check for the Identity Address when receiving
the Identity Address Information SMP PDU.

Signed-off-by: Johan Hedberg 
Signed-off-by: Marcel Holtmann 
Signed-off-by: Greg Kroah-Hartman 

---
 net/bluetooth/smp.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1392,8 +1392,12 @@ static int smp_cmd_ident_addr_info(struc
 * 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.
+*
+* The Identity Address must also be a Static Random or Public
+* Address, which hci_is_identity_address() checks for.
 */
-   if (!bacmp(>bdaddr, BDADDR_ANY)) {
+   if (!bacmp(>bdaddr, BDADDR_ANY) ||
+   !hci_is_identity_address(>bdaddr, info->addr_type)) {
BT_ERR("Ignoring IRK with no identity address");
goto distribute;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3.18 003/151] Bluetooth: Fix valid Identity Address check

2015-03-03 Thread Greg Kroah-Hartman
3.18-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hedberg johan.hedb...@intel.com

commit e12af489b91d47a806f4e96e4edc20df612482e7 upstream.

According to the Bluetooth core specification valid identity addresses
are either Public Device Addresses or Static Random Addresses. IRKs
received with any other type of address should be discarded since we
cannot assume to know the permanent identity of the peer device.

This patch fixes a missing check for the Identity Address when receiving
the Identity Address Information SMP PDU.

Signed-off-by: Johan Hedberg johan.hedb...@intel.com
Signed-off-by: Marcel Holtmann mar...@holtmann.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/bluetooth/smp.c |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -1392,8 +1392,12 @@ static int smp_cmd_ident_addr_info(struc
 * 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.
+*
+* The Identity Address must also be a Static Random or Public
+* Address, which hci_is_identity_address() checks for.
 */
-   if (!bacmp(info-bdaddr, BDADDR_ANY)) {
+   if (!bacmp(info-bdaddr, BDADDR_ANY) ||
+   !hci_is_identity_address(info-bdaddr, info-addr_type)) {
BT_ERR(Ignoring IRK with no identity address);
goto distribute;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/