frameworks_bluetooth/service
Lu Jia eeadab36e1 a2dp: Fix use-after-free on ACP disconnect during CONFIGURED state
bug: v/88938

When acting as A2DP ACP, if the remote side disconnects ACL right after
Set Configuration (before media channel is established), a2dp_info->stream
is freed in a2dp_info_destroy() while zblue's ep->stream still references
the same memory. The subsequent avdtp_release_work() then accesses freed
memory (use-after-free).

Fix by deferring a2dp_info cleanup in zblue_on_disconnected() when stream
is still alive. The cleanup is completed later in zblue_on_stream_released()
after zblue finishes its release work.

Also guard DISCONNECTED_EVT in zblue_on_stream_released() to only fire
when media channel was actually established, avoiding duplicate events
with zblue_on_disconnected().

Add debug logging to a2dp_info_destroy, zblue_on_stream_configured,
zblue_on_stream_released, and zblue_on_disconnected for easier diagnosis.

Signed-off-by: Lu Jia <jialu@xiaomi.com>
2026-04-27 23:14:56 +08:00
..
common Add persistent storage of the GATT server database hash using KVDB. 2026-04-27 23:14:53 +08:00
ipc cs : Add cs_set_config command to set RAS supported configuration and fix compilation warnings. 2026-04-27 23:14:55 +08:00
profiles hfp_hf: fix set_volume_cnt race causing AT+VGS not sent back to phone 2026-04-27 23:14:55 +08:00
src HFP: Keep ACL link active during SCO connection 2026-04-27 23:14:55 +08:00
stacks a2dp: Fix use-after-free on ACP disconnect during CONFIGURED state 2026-04-27 23:14:56 +08:00
utils bluetooth: add gatt client and server config 2026-04-27 23:14:52 +08:00
vendor Merge commit 2026-04-27 23:14:50 +08:00
vhal Merge commit 2026-04-27 23:14:50 +08:00