Android security tags, read closely by Lightrion

CVE-2025-22409 AI-generated analysis

platform/packages/modules/Bluetooth, system/stack (avct, bnep, hid, rfcomm, sdp)

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

Nine failure-path log statements in the Bluetooth stack (AVCT, BNEP, HID device, RFCOMM, SDP) read the buffer length after passing the buffer to L2CA_DataWrite. They now use a length captured before the call, or a pointer difference that was already computed, so they no longer read a buffer that may already have been freed.

Root cause

Several stack layers followed the same pattern: call L2CA_DataWrite(cid, p_buf), and if it does not return L2CAP_DW_SUCCESS, call log::warn("Unable to write L2CAP data ... len:{}", ..., p_buf->len). Per the commit message, the buffer may, in exceptional cases, have been freed by the preceding call, so the log argument read a possibly freed buffer. Affected sites: avct_lcb_act.cc:avct_lcb_msg_ind (AVCT_REJ packet), bnep_main.cc:bnep_congestion_ind (draining xmit_q), bnep_utils.cc:bnepu_check_send_packet, hidd_conn.cc:hidd_check_config_done (hd_cb.pending_data), rfc_ts_frames.cc:rfc_send_buf_uih, rfc_utils.cc:rfc_check_send_cmd (draining cmd_q), sdp_discovery.cc:process_service_attr_rsp, and sdp_server.cc:process_service_search and process_service_attr_req.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to March 2025 · Findings