The AVRCP browsing channel's L2CAP receive-buffer callback, browsing_avrcp_l2cap_alloc_buf() in subsys/bluetooth/host/classic/avrcp.c, allocated from the shared avctp_browsing_rx_pool with K_FOREVER. L2CAP вызывает обратный вызов из рабочей очереди Bluetooth RX (bt_workq, «BT RX WQ»), как для главного буфера нового SDU, так и — через l2cap_br_alloc_frag() и net_buf_append_bytes() — для каждого последующего фрагмента повторно собранного SDU. Тот же самый поток является единственным контекстом, который когда-либо выпускает эти буферы, после того, как bt_l2cap_br_recv_seg () поставляет завершенный SDU и вызывает net_buf_unref (), поэтому ожидание, принятое там, никогда не может быть удовлетворено.
Пул содержит CONFIG_BT_MAX_CONN + 1 буфер CONFIG_BT_AVRCP_BROWSING_L2CAP_MTU байт (два буфера по 339 байт в конфигурации по умолчанию). Подключенный одноранговый узел может истощить его, потому что bt_l2cap_br_recv_seg() в subsys/bluetooth/host/classic/l2cap_br.c принимает длину SDU, объявленную в сегменте SAR_START, не ограничивая ее br_chan->rx.mtu: одноранговый узел, который объявляет большой SDU, а затем сегменты продолжения потоков, заставляет один буфер пула на каждый сегмент данных. После того, как пул пуст, следующие блоки распределения навсегда внутри обратного звонка.
Для запуска уязвимости требуется сборка с CONFIG_BT_CLASSIC и экспериментальной опцией CONFIG_BT_AVRCP_BROWSING, приложением, которое регистрирует обратные вызовы AVRCP, и узлом BR / EDR, который установил канал управления AVRCP, а затем канал просмотра, который требует зашифрованной (парной) связи. Не требуется неправильно сформированный пакет — достаточно нескольких сотен байт обычного сегментированного трафика L2CAP. Следствием является постоянное зависание всего хоста Bluetooth, а не только AVRCP: заблокированный поток истощает bt_dev.rx_queue для всех данных HCI ACL и низкоприоритетных событий, а также запускает внутренние рабочие элементы хоста, поэтому все соединения перестают обслуживаться, и состояние не восстанавливается без перезагрузки.
Отсутствует компонент «коррупция памяти» или «разглашение информации». Исправление распределяется с K_NO_WAIT, поэтому пустой пул теперь выдает индикацию локальной занятости или отключение канала, из которого приложение может восстановиться.
Показать оригинальное описание (EN)
The AVRCP browsing channel's L2CAP receive-buffer callback, browsing_avrcp_l2cap_alloc_buf() in subsys/bluetooth/host/classic/avrcp.c, allocated from the shared avctp_browsing_rx_pool with K_FOREVER. L2CAP invokes that callback from the Bluetooth RX work queue thread (bt_workq, "BT RX WQ"), both for the head buffer of a new SDU and — through l2cap_br_alloc_frag() and net_buf_append_bytes() — for every further fragment of a reassembled SDU. That same thread is the only context that ever releases these buffers, after bt_l2cap_br_recv_seg() delivers a completed SDU and calls net_buf_unref(), so a wait taken there can never be satisfied. The pool holds CONFIG_BT_MAX_CONN + 1 buffers of CONFIG_BT_AVRCP_BROWSING_L2CAP_MTU bytes (two buffers of 339 bytes in the default configuration). A connected browsing peer can drain it because bt_l2cap_br_recv_seg() in subsys/bluetooth/host/classic/l2cap_br.c accepts the SDU length declared in an SAR_START segment without bounding it by br_chan->rx.mtu: a peer that announces a large SDU and then streams continuation segments forces one pool buffer per segment-worth of data. Once the pool is empty the next allocation blocks forever inside the callback. Triggering the flaw requires a build with CONFIG_BT_CLASSIC and the experimental CONFIG_BT_AVRCP_BROWSING option, an application that registers AVRCP callbacks, and a BR/EDR peer that has established the AVRCP control channel and then the browsing channel, which requires an encrypted (paired) link. No malformed packet is needed — a few hundred bytes of ordinary segmented L2CAP traffic suffice. The consequence is a permanent hang of the whole Bluetooth host, not just of AVRCP: the blocked thread drains bt_dev.rx_queue for all HCI ACL data and low-priority events and also runs the host's internal work items, so all connections stop being serviced and the state is unrecoverable without a reboot. There is no memory-corruption or information-disclosure component. The fix allocates with K_NO_WAIT, so an empty pool now yields a local-busy indication or a channel disconnect that the application can recover from.
Характеристики атаки
Последствия
Строка CVSS v3.1