In the Linux kernel, the following vulnerability has been resolved: staging: rtl8723bs: fix protected RX frame validation in decrypt path The RX software decrypt path mishandles crafted protected frames from a malicious AP in two ways: 1) decryptor() never checks that a protected frame is long enough to hold the 802.11 header plus the per-cipher trailer. Все rtw_wep_decrypt(), rtw_tkip_decrypt() и rtw_aes_decrypt() вычисляют длину hdr.len - hdrlen - iv_len; и действуют на результат, и recvframe_chkmic() аналогичным образом вычисляют datalen hdr.len - hdrlen - iv_len - icv_len - 8; для TKIP (8-байт Michael MIC не учитывается в icv_len). Кадр короче hdrlen + iv_len + icv_len (+ 8 для TKIP) подводит эти неподписанные вычеты, превращаясь в количество итераций 4 GiB в aes_decipher()/arc4_crypt()/rtw_seccalctkipmic () или 4 GiB crc32_le (), в результате чего out-of-bounds читает / записывает до 4 GiB, начиная с rx skb.
Отклоните такие кадры в расшифровщике (), прежде чем касаться IV; это охватывает все три шифра и проверку TKIP MIC, а также сохраняет безусловный доступ iv в кадре. 2) validate_80211w_mgmt() продолжает использовать фрейм - два memcpys через устаревший указатель rx_data и обновление pkt_len - перед тем, как проверить, вернулся ли расшифровщик () NULL. При отказе расшифровки (например, одноадресный защищенный кадр deauth/disassoc/action с плохим MIC, который этот путь всегда программно-расшифровывает) skb уже освобожден, так что это use-after-free чтение/запись, и путь ошибки вызывающего абонента освобождает кадр во второй раз, дрейфуя free_recvframe_cnt. Немедленно избавляйтесь от расшифровщика (), освобождая сначала временный буфер mgmt_DATA.
Обнаружен Atuin — Automated Vulnerability Discovery Engine.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: staging: rtl8723bs: fix protected RX frame validation in decrypt path The RX software decrypt path mishandles crafted protected frames from a malicious AP in two ways: 1) decryptor() never checks that a protected frame is long enough to hold the 802.11 header plus the per-cipher trailer. All of rtw_wep_decrypt(), rtw_tkip_decrypt() and rtw_aes_decrypt() compute length = hdr.len - hdrlen - iv_len; and act on the result, and recvframe_chkmic() similarly computes datalen = hdr.len - hdrlen - iv_len - icv_len - 8; for TKIP (the 8-byte Michael MIC is not accounted for in icv_len). A frame shorter than hdrlen + iv_len + icv_len (+ 8 for TKIP) underflows these unsigned subtractions, turning into a ~4 GiB iteration count in aes_decipher()/arc4_crypt()/rtw_seccalctkipmic() or a ~4 GiB crc32_le() length, causing out-of-bounds reads/writes of up to ~4 GiB starting from the rx skb. Reject such frames in decryptor() before touching the IV; this covers all three ciphers and the TKIP MIC check, and also keeps the unconditional iv[3] access within the frame. 2) validate_80211w_mgmt() keeps using the frame - two memcpys through the stale rx_data pointer and a pkt_len update - before checking whether decryptor() returned NULL. On decrypt failure (e.g. a unicast protected deauth/disassoc/action frame with a bad MIC, which this path always software-decrypts) the skb has already been freed, so this is a use-after-free read/write, and the caller's error path frees the frame a second time, drifting free_recvframe_cnt. Bail out immediately when decryptor() fails, freeing the temporary mgmt_DATA buffer first. Discovered by Atuin - Automated Vulnerability Discovery Engine.
Характеристики атаки
Последствия
Строка CVSS v3.1