Bluetooth: Fix incorrect removing of IRKs
authorJohan Hedberg <johan.hedberg@intel.com>
Tue, 26 Jan 2016 19:31:31 +0000 (14:31 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Mar 2016 23:07:16 +0000 (15:07 -0800)
commit701495c14d09658bffe78e0e605f298752edd36c
tree4c657863c919f23a75350ec18b5b2aff46315284
parent2b2b55a0d88ef81f33ea77f79cbdeee25b2ed891
Bluetooth: Fix incorrect removing of IRKs

commit cff10ce7b4f02718ffd25e3914e60559f5ef6ca0 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/hci_request.c
net/bluetooth/smp.c