Сигнальный уровень AVDTP использует 6-секундный тайм-аут команд (AVDTP_TIMEOUT) в avdtp_send_cmd () всякий раз, когда локальное устройство выдает запрос AVDTP. Каждый обработчик ответа в subsys/bluetooth/host/classic/avdtp.c отменяет session->timeout_work перед очисткой ожидающего запроса, но bt_avdtp_l2cap_disconnected() только очищает session->req и оставляет запаздывающую работу вооруженной. Сессия struct bt_avdtp является первым членом struct bt_a2dp, экземпляры которого живут в статическом массиве для подключения, а a2dp_get_connection() в subsys/bluetooth/host/classic/a2dp.c стирает слот с memset(), как только session->br_chan.chan.conn является NULL — что уровень L2CAP организует сразу после обратного вызова разъединения.
Удаленный одноранговый Bluetooth BR / EDR запускает условие, открывая сигнальный канал AVDTP, позволяя локальному приложению выдавать процедуру AVDTP (стандартный поток A2DP выдает bt_a2dp_discover () из подключенного обратного вызова), а затем разрывает сигнальный канал, не отвечая, и снова открывает его в оставшемся окне тайм-аута. Повторное соединение достигает a2dp_accept() a2dp_get_connection(), что обнуляет всю структуру bt_a2dp, в то время как struct _timeout элемента работы по-прежнему связан с глобальным списком таймаутов ядра. Оба момента отключения и повторного подключения выбираются атакующим, поэтому ни одна гонка не должна быть выиграна; требуется зашифрованная связь BR / EDR, и CONFIG_BT_A2DP (экспериментальный) должен быть включен.
С сервером по умолчанию CONFIG_TIMEOUT_BACKEND_DLIST ядро решает, что тайм-аут неактивен, проверяя, связан ли его узел списка, поэтому после memset() ядро обрабатывает узел, который все еще находится в глобальном списке тайм-аутов, как свободный: путь объявления выскакивает узел, чьи ссылки и указатель обработчика - NULL, а следующий bt_work_reschedule() на повторной сессии повторно вводит тот же узел в список, который уже содержит его. Следствием является повреждение структуры данных одного ядра каждый таймер, разрез и сон зависит от — пишет через нулевые или устаревшие указатели списка и отправку обработчика NULL — создавая общесистемный сбой или зависание, а не сбой, ограниченный сеансом A2DP. Исправление отменяет session->timeout_work в верхней части bt_avdtp_l2cap_disconnected() и перемещает k_work_init_delayable() из avdtp_send_cmd() на пути установки сеанса bt_avdtp_connect() и bt_avdtp_l2cap_accept(), поэтому рабочий элемент всегда инициализируется перед запуском обратного вызова.
Показать оригинальное описание (EN)
The AVDTP signalling layer arms a 6-second command timeout (AVDTP_TIMEOUT) in avdtp_send_cmd() whenever the local device issues an AVDTP request. Every response handler in subsys/bluetooth/host/classic/avdtp.c cancels session->timeout_work before clearing the pending request, but bt_avdtp_l2cap_disconnected() only cleared session->req and left the delayable work armed. The struct bt_avdtp session is the first member of struct bt_a2dp, whose instances live in a static per-connection array, and a2dp_get_connection() in subsys/bluetooth/host/classic/a2dp.c wipes a slot with memset() as soon as session->br_chan.chan.conn is NULL — which the L2CAP layer arranges immediately after the disconnect callback returns. A remote Bluetooth BR/EDR peer triggers the condition by opening the AVDTP signalling channel, letting the local application issue an AVDTP procedure (the standard A2DP flow issues bt_a2dp_discover() from the connected callback), then tearing the signalling channel down without responding and re-opening it within the remaining timeout window. The reconnect reaches a2dp_accept() → a2dp_get_connection(), which zeroes the whole struct bt_a2dp while the work item's struct _timeout is still linked into the kernel's global timeout list. Both the disconnect and the reconnect instants are chosen by the attacker, so no race has to be won; an encrypted BR/EDR link is required, and CONFIG_BT_A2DP (experimental) must be enabled. With the default CONFIG_TIMEOUT_BACKEND_DLIST backend the kernel decides a timeout is inactive by testing whether its list node is linked, so after the memset() the kernel treats a node that is still on the global timeout list as free: the announce path pops a node whose links and handler pointer are NULL, and the next bt_work_reschedule() on the recycled session re-inserts the same node into a list that already contains it. The consequence is corruption of the single kernel data structure every timer, timeslice and sleep depends on — writes through zeroed or stale list pointers and a NULL handler dispatch — producing a system-wide crash or hang rather than a fault confined to the A2DP session. The fix cancels session->timeout_work at the top of bt_avdtp_l2cap_disconnected() and moves k_work_init_delayable() from avdtp_send_cmd() to the session-establishment paths bt_avdtp_connect() and bt_avdtp_l2cap_accept(), so the work item is always initialized before a disconnect callback can run.
Характеристики атаки
Последствия
Строка CVSS v3.1