Роль AVRCP Target в subsys/bluetooth/host/classic/avrcp.c сохраняет свое зависимое от поставщика состояние передачи ответа в объекте подключения, выбранном по индексу подключения (get_avrcp_tg()), с контекстом передачи (tid, sent_len и флаг BT_AVRCP_TG_FLAG_TX_ONGOING), хранящимся в user_data очерёдного ответа net_buf. Обработчик AVCTP deardown avrcp_disconnected() не отменил tg->vd_rsp_tx_work и не выпустил буферы, все еще стоящие в очереди на tg->vd_rsp_tx_pending, поэтому падение ссылки в середине фрагментированного ответа оставило буфер в списке с TX_ONGOING все еще установленным. Удаленный AVRCP Controller может вызвать это детерминированно: он выдает зависимую от поставщика команду, чей ответ превышает один фрагмент AVRCP (например, GetElementAttributes или GetCapabilities), позволяет bt_avrcp_tg_vendor_tx_work() излучать фрагмент START, а затем отбрасывает ссылку ACL вместо отправки REQUEST_CONTINUING_RESPONSE.
Канал управления AVCTP требует зашифрованной BR/EDR-линии (BT_SECURITY_L2), поэтому атакующий должен быть спаренным пиром в пределах радиодиапазона; никакого взаимодействия с пользователем не требуется. Поскольку объекты Target статичны и повторно используются, следующее соединение, приземляющееся на тот же индекс подключения, находит устаревший буфер во главе vd_rsp_tx_pending. Каждый запуск работы TX видит TX_ONGOING и немедленно возвращается, поэтому все дальнейшие зависящие от поставщика ответы стоят в очереди за устаревшей головкой и никогда не отправляются — постоянная потеря функции AVRCP Target, которую не очищает ни один тайм-аут, и только перезагрузка восстанавливается.
Каждый цикл также пропускает один буфер ответа из неглубокого пула приложений, и новый узел, который отправляет REQUEST_CONTINUING_RESPONSE, очищает устаревший TX_ONGOING через bt_avrcp_tg_process_continuing_cmd(), в результате чего в него передается неотправленный остаток ответа предыдущего узла. Исправление отменяет tg->vd_rsp_tx_work и отменяет каждый буфер на tg->vd_rsp_tx_pending в avrcp_disconnected(); поскольку контекст TX находится в буфере user_data, выпуск буферов также сбрасывает состояние машины TX. Повреждения памяти нет: предварительно исправленный буфер просочился с живой ссылкой, поэтому use-after-free не возникает.
Показать оригинальное описание (EN)
The AVRCP Target role in subsys/bluetooth/host/classic/avrcp.c keeps its vendor-dependent response transmit state in a per-connection object selected by connection index (get_avrcp_tg()), with the per-transfer context (tid, sent_len, and the BT_AVRCP_TG_FLAG_TX_ONGOING flag) stored in the user_data of the queued response net_buf. The AVCTP teardown handler avrcp_disconnected() did not cancel tg->vd_rsp_tx_work and did not release the buffers still queued on tg->vd_rsp_tx_pending, so a link drop in the middle of a fragmented response left the buffer on the list with TX_ONGOING still set. A remote AVRCP Controller can trigger this deterministically: it issues a vendor-dependent command whose response exceeds one AVRCP fragment (for example GetElementAttributes or GetCapabilities), lets bt_avrcp_tg_vendor_tx_work() emit the START fragment, and then drops the ACL link instead of sending REQUEST_CONTINUING_RESPONSE. The AVCTP control channel requires an encrypted BR/EDR link (BT_SECURITY_L2), so the attacker must be a paired peer within radio range; no user interaction is needed. Because the Target objects are static and reused, the next connection landing on the same connection index finds the stale buffer at the head of vd_rsp_tx_pending. Every run of the TX work sees TX_ONGOING and returns immediately, so all further vendor-dependent responses queue behind the stale head and are never sent — a persistent loss of AVRCP Target function that no timeout clears and only a reboot recovers. Each cycle also leaks one response buffer from a shallow application pool, and a new peer that sends REQUEST_CONTINUING_RESPONSE clears the stale TX_ONGOING via bt_avrcp_tg_process_continuing_cmd(), causing the un-sent remainder of the previous peer's response to be transmitted to it. The fix cancels tg->vd_rsp_tx_work and unrefs every buffer on tg->vd_rsp_tx_pending in avrcp_disconnected(); since the TX context lives in the buffer user_data, releasing the buffers also resets the TX state machine. There is no memory corruption: the pre-fix buffer is leaked with a live reference, so no use-after-free arises.
Характеристики атаки
Последствия
Строка CVSS v3.1