Реализация Bluetooth Classic Hands-Free Profile Audio Gateway в subsys/bluetooth/host/classic/hfp_ag.c сохраняет свои структурные объекты bt_hfp_ag в статическом пуле, индексируемом индексом подключения ACL. При разрыве ссылки hfp_ag_disconnected () отменяет ag->tx_work и элементы работы по вызову, а затем очищает ag->acl_conn, который отмечает слот для пула как свободный, но оставляет ag->ongoing_call_work (и ag->slc_work) нетронутым. Следующее соединение, которое попадает на тот же слот, входит в hfp_ag_create(), единственным тестом на заполняемость которого является ag->acl_conn, и сразу же выполняет memset(ag, 0, sizeof(struct bt_hfp_ag)), за которым следует k_work_init_delayable().
Обнуление и повторная инициализация k_work_delayable, чей узел struct _timeout все еще связан с списком таймаутов ядра, оставляет ядро со ссылкой на узел с NULL пред/следующими ссылками. ag->ongoing_call_work вооружен удаленным узлом: когда блок Hands-Free отправляет AT + CIND? во время установки Service Level Connection, и приложение обеспечивает асинхронный get_ongoing_call обратный звонок, AG планирует работу за CONFIG_BT_HFP_AG_GET_ONGOING_CALL_TIMEOUT миллисекунд. Таймер отменяется только в том случае, если приложение отвечает вовремя через bt_hfp_ag_ongoing_calls(). Узел, который отправляет AT + CIND?, затем отключает HFP RFCOMM DLC, а затем немедленно снова открывает его по той же ссылке ACL, повторно использует тот же слот для пула, пока тайм-аут еще не завершен - сервер AG RFCOMM принимает путь (hfp_ag_accept ()) вызывает hfp_ag_create (), поэтому удаленная сторона управляет как разбором, так и повторным созданием.
Результатом является повреждение списка тайм-аутов ядра: sys_dlist_remove() на нольном узле выполняет запись через указатели NULL с пути объявления часов, а перепланировка повторно начатой работы повторно вводит узел, на который уже ссылается список, создавая цикл, который цикл объявления проходит с заблокированными прерываниями. Наблюдаемое воздействие является ошибкой или зависанием всей системы, то есть отказом в обслуживании, доступным из радиодиапазона Bluetooth; данные, контролируемые злоумышленником, не записываются, поэтому это само по себе не приводит к выполнению кода. Экспозиция ограничена сборками с CONFIG_BT_HFP_AG (отмеченными экспериментально и отключенными по умолчанию), чье приложение реализует асинхронный вызов get_ongoing_call.
Показать оригинальное описание (EN)
The Bluetooth Classic Hands-Free Profile Audio Gateway implementation in subsys/bluetooth/host/classic/hfp_ag.c keeps its struct bt_hfp_ag objects in a static pool indexed by ACL connection index. On link teardown, hfp_ag_disconnected() cancels ag->tx_work and the per-call work items and then clears ag->acl_conn, which marks the pool slot as free — but it leaves ag->ongoing_call_work (and ag->slc_work) untouched. The next connection that lands on the same slot enters hfp_ag_create(), whose only occupancy test is ag->acl_conn, and immediately executes memset(ag, 0, sizeof(struct bt_hfp_ag)) followed by k_work_init_delayable(). Zeroing and re-initialising a k_work_delayable whose struct _timeout node is still linked into the kernel timeout list leaves the kernel holding a reference to a node with NULL prev/next links. ag->ongoing_call_work is armed by the remote peer: when a Hands-Free unit sends AT+CIND? during Service Level Connection establishment and the application provides the asynchronous get_ongoing_call callback, the AG schedules the work for CONFIG_BT_HFP_AG_GET_ONGOING_CALL_TIMEOUT milliseconds (default 10000). The timer is cancelled only if the application answers in time via bt_hfp_ag_ongoing_calls(). A peer that sends AT+CIND?, then disconnects the HFP RFCOMM DLC, then immediately re-opens it on the same ACL link, reuses the same pool slot deterministically while the timeout is still pending — the AG's RFCOMM server accept path (hfp_ag_accept()) calls hfp_ag_create() directly, so the remote side drives both teardown and re-creation. The result is corruption of the kernel's timeout list: sys_dlist_remove() on the zeroed node performs writes through NULL pointers from the clock-announce path, and rescheduling the re-initialised work re-inserts a node the list already references, creating a cycle that the announce loop walks with interrupts locked. The observable impact is a fault or hang of the whole system, i.e. a denial of service reachable from Bluetooth radio range; no attacker-controlled data is written, so this does not by itself yield code execution. Exposure is limited to builds with CONFIG_BT_HFP_AG (marked experimental and disabled by default) whose application implements the asynchronous get_ongoing_call callback.
Характеристики атаки
Последствия
Строка CVSS v3.1