Android security tags, read closely by Lightrion

CVE-2024-49747 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 (4 corrections). Verify against the commit before relying on it.

Adds an early return in four GATT server request handlers in system/stack/gatt/gatt_sr.cc when the transmit payload size returned for the channel is 0 (channel already closed), so a response buffer sized from that zero length is never allocated and written past.

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 obtain payload_size from gatt_tcb_get_payload_size_tx(tcb, cid) (gatt_tcb_get_payload_size on Android 15) and use it to size the response buffer: sizeof(BT_HDR) + payload_size + L2CAP_MIN_OFFSET. Per the commit message, in exceptional cases the channel can already be closed when the function is called, so it returns 0. The handlers then build the response into a buffer with no room for payload, and subsequent processing writes out of bounds.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to January 2025 · Findings