В ядре Linux была устранена следующая уязвимость: wifi: mac80211: перезагрузите указатель заголовка TDLS после skb_linearize() ieee80211_process_tdls_channel_switch() устанавливает tf skb->data, прежде чем он вызовет skb_linearize(), и после этого читает tf->action_code. ieee80211_rx_h_data() очереди TDLS запросов на коммутацию каналов и ответов на интерфейс после вытягивания только офсета(struct ieee80211_tdls_data, u), u) байт. Драйверы, которые строят skb RX, делают это для каждого кадра, который не вписывается в skb-головку, например, iwlwifi (mvm), который также является единственным драйвером mac80211, который устанавливает NL80211_FEATURE_TDLS_CHANNEL_SWITCH. Если оставшиеся данные не вписываются в хвостовую комнату, skb_linearize() перемещает данные в новую голову и освобождает старую, после чего код действия считывается из свободной памяти.
В зависимости от того, что эта память хранит к тому времени, кадр обрабатывается как раньше или заканчивается в WARN_ON_ONCE () случая по умолчанию. Кадр должен быть только кадром данных с эфирным типом TDLS от авторизованного узла, например, ретранслируемым AP с другой станции в BSS; чтение происходит до того, как отправитель проверяется на то, чтобы быть узлом TDLS. Загрузите tf после skb_linearize(), как это уже делают обработчики запросов и ответов.
Обнаружено инструментом статического анализа CodeQL.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: wifi: mac80211: reload TDLS header pointer after skb_linearize() ieee80211_process_tdls_channel_switch() sets tf = skb->data before it calls skb_linearize(), and reads tf->action_code afterwards. ieee80211_rx_h_data() queues TDLS channel switch requests and responses to the interface after pulling only offsetof(struct ieee80211_tdls_data, u) bytes, so the skb can still be non-linear when the interface work handles it. Drivers that build paged RX skbs do this for every frame that does not fit into the skb head, e.g. iwlwifi (mvm), which is also the only mac80211 driver that sets NL80211_FEATURE_TDLS_CHANNEL_SWITCH. If the remaining data does not fit into the tailroom, skb_linearize() moves the data to a new head and frees the old one, and the action code is then read from freed memory. Depending on what that memory holds by then, the frame is handled as before or ends in the WARN_ON_ONCE() of the default case. The frame only has to be a data frame with the TDLS ethertype from an authorized peer, e.g. relayed by the AP from another station in the BSS; the read happens before the sender is checked to be a TDLS peer. Load tf after skb_linearize(), as the request and response handlers already do. Found by static analysis tool CodeQL.