Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35749bd5 authored by Calvin On's avatar Calvin On Committed by Md Shahriar Hossain Sajib
Browse files

BTM resolve race condition in ble local resolving list

The BLE advertiser address resolving list is stored on the controller,
a local copy is kept on the host. The updates to the local copy did not
always match the remote list.

In this change the update of the local list for the add operation
is moved to the callback in order to ensure the order of operations at
the controller is respected and that the operation was successful.

Bug: 119574882
Bug: 199827901
Test: gd/cert/run
Tag: #stability
Change-Id: Ib215590e4a292b8d04fcb1a46c13b464d517c73c
(cherry picked from commit 545acfc3b6c4287013edd0b1fc298af2339903f7)
(cherry picked from commit 6aed4a163a739bd57fc3a535b8b1f8e43a7089bf)
parent fc5f8271
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -280,6 +280,7 @@ void btm_ble_add_resolving_list_entry_complete(uint8_t* p, uint16_t evt_len) {
  }

  if (status == HCI_SUCCESS) {
    btm_ble_update_resolving_list(pseudo_bda, true);
    /* privacy 1.2 command complete does not have these extra byte */
    if (evt_len > 2) {
      /* VSC complete has one extra byte for op code, skip it here */
@@ -740,7 +741,6 @@ bool btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC* p_dev_rec) {
    return false;
  }

  btm_ble_update_resolving_list(p_dev_rec->bd_addr, true);
  if (controller_get_interface()->supports_ble_privacy()) {
    const Octet16& peer_irk = p_dev_rec->ble.keys.irk;
    const Octet16& local_irk = btm_cb.devcb.id_keys.irk;