bt_att_find_req_by_user_data() в subsys/bluetooth/host/att.c проходит каждый канал ATT, подключенный к соединению, и удаляет ссылки chan->req->user_data без проверки chan->req. Канал ATT без клиентского запроса в полете держит chan->req NULL — это его обычное состояние холостого хода, установленное att_handle_rsp (), когда ответ разрешает транзакцию и протестирован att_req_send_process (), чтобы выбрать свободный канал — так что поиск читает через указатель NULL, как только он посещает канал холостого хода. Каждый другой пользователь chan->req в файле уже охраняет указатель.
Поиск осуществляется с публичного bt_gatt_cancel() API и, что более важно, с самого хоста: bt_gatt_unsubscribe () вызывает bt_gatt_cancel (), в то время как подписка на запись CCC все еще остается незавершенной (BT_GATT_SUBSCRIBE_FLAG_WRITE_PENDING), а call_notify_cb_and_maybe_unsubscribe () в subsys/bluetooth/host/gatt.c вызывает bt_gatt_unsubscribe () с пути RX всякий раз, когда приложение возвращает обратный вызов BT_GATT_ITER_STOP. Злоумышленник или неисправный узел может удерживать триггерное окно открытым, удерживая ATT Write Response в записи CCC, а затем отправляя уведомление для подписанного узла. С CONFIG_BT_EATT обход, скорее всего, встретится с неработающим родственным каналом, поскольку каналы ATT предварительно включены в список, и канал, открытый после отправки ожидающего запроса, посещается первым.
Дереференция - это чтение небольшого постоянного смещения от нулевого адреса, поэтому воздействие - это только доступность: отсутствие повреждения памяти, отсутствие выбранного злоумышленником адреса и отсутствие раскрытия информации. На платформах и конфигурациях, где почти NULL-ловушки чтения — незащищенные изображения TrustZone, цели MMU, native_sim или сборки с CONFIG_NULL_POINTER_EXCEPTION_DETECTION_MPU/_DWT — неисправность возникает в контексте Bluetooth RX и приводит к фатальной ошибке и сбросу устройства. На простой сборке Cortex-M с векторной таблицей, отображаемой по адресу 0, и отключенным обнаружением нулевого указателя (по умолчанию), чтение проходит успешно, и дефект является инертным.
Исправление добавляет явный тест chan->req ! NULL к обходу канала и дополнительно отвергает аргумент NULL user_data, который в противном случае соответствовал бы и отменял не связанный запрос.
Показать оригинальное описание (EN)
bt_att_find_req_by_user_data() in subsys/bluetooth/host/att.c walks every ATT channel attached to a connection and dereferences chan->req->user_data without checking chan->req. An ATT channel with no client request in flight holds chan->req == NULL — that is its normal idle state, set by att_handle_rsp() when a response resolves the transaction and tested by att_req_send_process() to pick a free channel — so the lookup reads through a NULL pointer as soon as it visits an idle channel. Every other chan->req user in the file already guards the pointer. The lookup is reached from the public bt_gatt_cancel() API and, more importantly, from the host itself: bt_gatt_unsubscribe() calls bt_gatt_cancel() while a subscribe CCC write is still outstanding (BT_GATT_SUBSCRIBE_FLAG_WRITE_PENDING), and call_notify_cb_and_maybe_unsubscribe() in subsys/bluetooth/host/gatt.c invokes bt_gatt_unsubscribe() from the RX path whenever an application notify callback returns BT_GATT_ITER_STOP. A malicious or malfunctioning peer can hold the trigger window open by withholding the ATT Write Response to the CCC write and then sending a notification for the subscribed handle. With CONFIG_BT_EATT the traversal is very likely to meet an idle sibling channel, since ATT channels are prepended to the list and a channel opened after the pending request was sent is visited first. The dereference is a read of a small constant offset from address zero, so the impact is availability only: no memory corruption, no attacker-chosen address and no information disclosure. On platforms and configurations where a near-NULL read traps — TrustZone non-secure images, MMU targets, native_sim, or builds with CONFIG_NULL_POINTER_EXCEPTION_DETECTION_MPU/_DWT — the fault occurs in the Bluetooth RX context and results in a fatal error and device reset. On a plain Cortex-M build with the vector table mapped at address 0 and null-pointer detection disabled (the default) the read succeeds and the defect is inert. The fix adds an explicit chan->req != NULL test to the channel traversal and additionally rejects a NULL user_data argument, which would otherwise have matched, and cancelled, an unrelated request.
Характеристики атаки
Последствия
Строка CVSS v3.1