В ядре Linux устранена следующая уязвимость:
wifi: mwifiex: привязал IE событий ассоциации uAP к буферу событий.
mwifiex_process_uap_event() обрабатывает EVENT_UAP_STA_ASSOC, раскрывая
IE запроса (ре)ассоциации, которые встроенное ПО копирует в событие:
sinfo->assoc_req_ies = &event->data[len];
len = (u8 *)sinfo->assoc_req_ies - (u8 *)&event->frame_control;
sinfo->assoc_req_ies_len = le16_to_cpu(event->len) - (u16)len;
event->len предоставляется прошивкой устройства и никогда не проверяется,
и вычитание не отмечено. assoc_req_ies указывает на
адаптер->event_body[MAX_EVENT_SIZE], массив фиксированного размера, встроенный в
kmalloc() создал структуру mwifiex_adapter. По пути ap_11n_enabled mwifiex_set_sta_ht_cap() обходит эти IE с помощью
cfg80211_find_ie(), чей цикл for_each_element() разыменовывает каждый
заголовок элемента. Событие, сообщаемое прошивкой->len, размер которого превышает байты
фактически полученное заставляет assoc_req_ies_len описывать IE, выходящие за пределы
event_body, поэтому обход считывает объект адаптерной плиты,
чтение плиты за пределами границ (KASAN: плита за пределами границ в cfg80211_find_ie).
Событие->len, меньшее, чем заголовок, вместо этого выполняет вычитание int
отрицательный, который преобразуется в огромный размер size_t при хранении в assoc_req_ies_len. Такая же длина передается в cfg80211_new_sta(), поэтому более скромное значение.
overclaim также может копировать устаревшие байты event_body в
Уведомление NL80211_CMD_NEW_STATION. Вредоносное или неисправное устройство mwifiex (USB/SDIO/PCIe) может доставлять
такое событие происходит, когда интерфейс находится в режиме AP/uAP.
Проверьте event->len перед использованием: отклоните длину, которая меньше указанного значения.
заголовок или это поместило бы IE за пределы буфера event_body[]
событие было скопировано. event->len здесь — структура mwifiex_assoc_event.len,
поле полезной нагрузки, внутреннее для этого события, а не длина транспортного кадра,
поэтому он проверяется в этом обработчике, а не в общем
Путь получения MWIFIEX_TYPE_EVENT, который видит только причину события и
длина транспортной рамы. Привязка относится к event_body[MAX_EVENT_SIZE]
а не фактически полученную длину, поскольку транспорты хранят
событие по-разному (USB и SDIO оставляют 4-байтовый заголовок события в
event_skb, PCIe удаляет его через skb_pull), тогда как event_body является единственным
фиксированный буфер, в который все копируют событие. Это путь события
аналог проверки границ пути приема, добавленный в коммите 119585281617
(«wifi: mwifiex: исправление OOB и целочисленного переполнения при приеме пакетов»).
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: wifi: mwifiex: bound uAP association event IEs to the event buffer mwifiex_process_uap_event() handles EVENT_UAP_STA_ASSOC by exposing the (re)association request IEs that the firmware copies into the event: sinfo->assoc_req_ies = &event->data[len]; len = (u8 *)sinfo->assoc_req_ies - (u8 *)&event->frame_control; sinfo->assoc_req_ies_len = le16_to_cpu(event->len) - (u16)len; event->len is supplied by the device firmware and is never validated, and the subtraction is unchecked. assoc_req_ies points into adapter->event_body[MAX_EVENT_SIZE], a fixed-size array embedded in the kmalloc()'d struct mwifiex_adapter. On the ap_11n_enabled path mwifiex_set_sta_ht_cap() walks these IEs with cfg80211_find_ie(), whose for_each_element() loop dereferences each element header. A firmware-reported event->len larger than the bytes actually received makes assoc_req_ies_len describe IEs that extend past event_body, so the walk reads out of the adapter slab object, a slab-out-of-bounds read (KASAN: slab-out-of-bounds in cfg80211_find_ie). An event->len smaller than the header instead makes the int subtraction negative, which wraps to a huge size_t when stored in assoc_req_ies_len. The same length is handed to cfg80211_new_sta(), so a more modest over-claim can also copy stale event_body bytes into the NL80211_CMD_NEW_STATION notification. A malicious or malfunctioning mwifiex device (USB/SDIO/PCIe) can deliver such an event while the interface is in AP/uAP mode. Validate event->len before use: reject a length that underflows the header or that would place the IEs outside the event_body[] buffer the event was copied into. event->len here is struct mwifiex_assoc_event.len, a payload field internal to this event, not the transport frame length, so it is validated in this handler rather than at the generic MWIFIEX_TYPE_EVENT receive path, which only sees the event cause and the transport frame length. The bound is against event_body[MAX_EVENT_SIZE] rather than the actually-received length because the transports store the event differently (USB and SDIO leave the 4-byte event header in event_skb, PCIe strips it via skb_pull), whereas event_body is the single fixed buffer all of them copy the event into. This is the event-path analogue of the receive-path bounds checks added in commit 119585281617 ("wifi: mwifiex: Fix OOB and integer underflow when rx packets").
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.5
|
6.6.148
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.5
|
6.12.101
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.5
|
6.18.42
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.5
|
7.1.6
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.5
|
7.2
|