diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-01-26 22:31:31 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2016-01-29 13:47:24 +0300 |
commit | cff10ce7b4f02718ffd25e3914e60559f5ef6ca0 (patch) | |
tree | d16e8c0b4420e75f8c496d3cf102bd80cde4ea2e /net/bluetooth/smp.c | |
parent | a2342c5fe5f2810b8ef6a0826bd584aa709dd2c6 (diff) | |
download | linux-cff10ce7b4f02718ffd25e3914e60559f5ef6ca0.tar.xz |
Bluetooth: Fix incorrect removing of IRKs
The commit cad20c278085d893ebd616cd20c0747a8e9d53c7 was supposed to
fix handling of devices first using public addresses and then
switching to RPAs after pairing. Unfortunately it missed a couple of
key places in the code.
1. When evaluating which devices should be removed from the existing
white list we also need to consider whether we have an IRK for them or
not, i.e. a call to hci_find_irk_by_addr() is needed.
2. In smp_notify_keys() we should not be requiring the knowledge of
the RPA, but should simply keep the IRK around if the other conditions
require it.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Cc: stable@vger.kernel.org # 4.4+
Diffstat (limited to 'net/bluetooth/smp.c')
-rw-r--r-- | net/bluetooth/smp.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c index ffed8a1d4f27..4b175df35184 100644 --- a/net/bluetooth/smp.c +++ b/net/bluetooth/smp.c @@ -1072,22 +1072,6 @@ static void smp_notify_keys(struct l2cap_conn *conn) hcon->dst_type = smp->remote_irk->addr_type; queue_work(hdev->workqueue, &conn->id_addr_update_work); } - - /* When receiving an indentity resolving key for - * a remote device that does not use a resolvable - * private address, just remove the key so that - * it is possible to use the controller white - * list for scanning. - * - * Userspace will have been told to not store - * this key at this point. So it is safe to - * just remove it. - */ - if (!bacmp(&smp->remote_irk->rpa, BDADDR_ANY)) { - list_del_rcu(&smp->remote_irk->list); - kfree_rcu(smp->remote_irk, rcu); - smp->remote_irk = NULL; - } } if (smp->csrk) { |