Android security tags, read closely by Lightrion

CVE-2023-40080 AI-generated analysis

platform/packages/modules/Bluetooth, BT stack BLE GAP periodic advertising sync (system/stack/btm/btm_ble_gap.cc)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (7 corrections). Verify against the commit before relying on it.

Adds MAX_SYNC_TRANSACTION checks on the index returned by the periodic-sync table lookups in system/stack/btm/btm_ble_gap.cc before it is used to address btm_ble_pa_sync_cb.p_sync[] and btm_ble_pa_sync_cb.sync_transfer[], across five functions.

Root cause

The added checks show that btm_ble_get_psync_index(sid, addr) and btm_ble_get_free_sync_transfer_index() can return MAX_SYNC_TRANSACTION as a 'not found / no free slot' value. In btm_ble_start_sync_request and btm_ble_start_sync_timeout, the result of btm_ble_get_psync_index was used directly to form &btm_ble_pa_sync_cb.p_sync[index] without checking for that value; btm_ble_start_sync_request then wrote p->sync_state. In BTM_BlePeriodicSyncTransfer and BTM_BlePeriodicSyncSetInfo, the result of btm_ble_get_free_sync_transfer_index was used directly as &btm_ble_pa_sync_cb.sync_transfer[index] and written (p_sync_transfer->in_use = true) without a check. In BTM_BleStartPeriodicSync the sentinel was already checked, but the pointer &p_sync[index] was computed before the check. The commit title describes these as OOB bugs.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to December 2023 · Findings