Android security tags, read closely by Lightrion

CVE-2023-45773 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 (6 corrections). Verify against the commit before relying on it.

Adds MAX_SYNC_TRANSACTION sentinel checks before indexing the periodic-sync tables (p_sync[] and sync_transfer[]) in five functions of system/stack/btm/btm_ble_gap.cc, so a failed index lookup no longer leads to an out-of-bounds access.

Root cause

The helpers btm_ble_get_psync_index(), btm_ble_get_free_psync_index() and btm_ble_get_free_sync_transfer_index() can return MAX_SYNC_TRANSACTION when no matching or free slot is found (the fix treats that value as the failure case). Several callers used the return value directly to index btm_ble_pa_sync_cb.p_sync[] or btm_ble_pa_sync_cb.sync_transfer[]. btm_ble_start_sync_request then wrote p->sync_state, and the sync_transfer paths wrote in_use, through the resulting pointer. btm_ble_start_sync_request and btm_ble_start_sync_timeout had no check at all. BTM_BlePeriodicSyncTransfer and BTM_BlePeriodicSyncSetInfo had no check after getting a free sync_transfer index. BTM_BleStartPeriodicSync already had the check, but formed the element pointer before it.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to December 2023 · Findings