Android security tags, read closely by Lightrion

CVE-2024-43771 AI-generated analysis

platform/packages/modules/Bluetooth, GATT server (system/stack/gatt/gatt_sr.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 (5 corrections). Verify against the commit before relying on it.

Adds early-return checks for a zero payload size (returned by gatt_tcb_get_payload_size_tx when the channel is already closed) in four ATT server request handlers in system/stack/gatt/gatt_sr.cc. This stops undersized response buffers from being allocated and written out of bounds.

Root cause

In gatt_sr.cc, gatts_process_primary_service_req, gatts_process_find_info, gatts_process_read_by_type_req and gatts_process_read_req call gatt_tcb_get_payload_size_tx(tcb, cid). They use the result directly to size the response buffer (sizeof(BT_HDR) + payload_size + L2CAP_MIN_OFFSET) and to bound later writes. The commit message says that in exceptional cases the channel can already be closed when the function is called, so the returned payload size is 0. The handlers did not check for this, so later processing caused an OOB write.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to January 2025 · Findings