aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-01-14 13:51:37 -0500
committerMarcel Holtmann <marcel@holtmann.org>2015-01-14 16:48:06 -0500
commite12af489b91d47a806f4e96e4edc20df612482e7 (patch)
treeb771ff7bc68c8a55d009a0227b98567cebdad67b /net/bluetooth
parent36c269cecf05d643ddeff3a0f515e7fde5609a77 (diff)
Bluetooth: Fix valid Identity Address check
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.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Cc: stable@vger.kernel.org # 3.17+
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/smp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 379654e70e6f..04e49f8f0982 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -2305,8 +2305,12 @@ static int smp_cmd_ident_addr_info(struct l2cap_conn *conn,
2305 * implementations are not known of and in order to not over 2305 * implementations are not known of and in order to not over
2306 * complicate our implementation, simply pretend that we never 2306 * complicate our implementation, simply pretend that we never
2307 * received an IRK for such a device. 2307 * received an IRK for such a device.
2308 *
2309 * The Identity Address must also be a Static Random or Public
2310 * Address, which hci_is_identity_address() checks for.
2308 */ 2311 */
2309 if (!bacmp(&info->bdaddr, BDADDR_ANY)) { 2312 if (!bacmp(&info->bdaddr, BDADDR_ANY) ||
2313 !hci_is_identity_address(&info->bdaddr, info->addr_type)) {
2310 BT_ERR("Ignoring IRK with no identity address"); 2314 BT_ERR("Ignoring IRK with no identity address");
2311 goto distribute; 2315 goto distribute;
2312 } 2316 }