Zephyr
Zephyr-дің TCP тақырыпшасын өңдеуі әлі пайдаланылып жатқан жадты босатады және TCP тақырыпшасы буфер фрагменттері бойынша бөлінген кезде қабылдау буферлерін жоғалтады. Шабуылдаушы аутентификациясыз, қашықтан, IPv6 кеңейту тақырыпшасын пайдаланып, тақырыпшаны буфер шекарасы арқылы орналастыратын арнайы жасалған бір TCP сегментін жіберіп, қабылдау буферлерінің пулын сарқып, қызмет көрсетуден бас тартуды тудыруы мүмкін.
Түйіндемені дереккөздер негізінде ЖИ жасаған және ол автоматты түрде аударылған.
Zephyr 2.3.0 нұсқасынан 4.3.2 нұсқасына дейін, және 4.4.0 нұсқасынан 4.5.0 нұсқасына дейін, қабылданған TCP тақырыпшасы net_buf шекарасын кесіп өткенде. 4.3.2 және 4.5.0 нұсқаларында түзетілген.
Қабылдау буферлерінің пулын қайта жүктегенге дейін сарқу арқылы қашықтан қызмет көрсетуден бас тарту және фрагмент дәл босатылған кезде жадтың бүлінуі (use-after-free және double free).
Түзетілген нұсқалар: 4.3.24.5.0
| zephyr | бастап 2.3.0 → түзетілді 4.3.2 бастап 4.4.0 → түзетілді 4.5.0 |
Zephyr RTOS микробағдарламасын TCP желілік мүмкіндігімен жеткізетін командалар, 2.3.0 нұсқасынан 4.3.2 нұсқасына дейін және 4.4.0 нұсқасынан 4.5.0 нұсқасына дейін
Қабылданған TCP тақырыпшасы net_buf шекарасы бойынша бөлінген кезде, Zephyr-дің тақырыпшаны сызықтандыруы әлі пайдаланылып жатқан жадты босатуы мүмкін, және дәл босатылған фрагмент екі рет босатылуы мүмкін. Қайталанатын жағдайлар қабылдау буферлерінің пулын сарқуы мүмкін, содан кейін құрылғы қайта жүктелгенше желілік трафикті қабылдауды тоқтатады.
Zephyr нұсқалары 2.3.0-ден 4.3.2-ге дейін, және 4.4.0-ден 4.5.0-ге дейін әсер ету ауқымында. Қате net_buf шекарасын кесіп өтетін TCP тақырыбын қабылдауды қажет етеді, сондықтан оқырман тексеруді бастау үшін пайдаланылатын Zephyr нұсқасын осы ауқымдармен салыстыра алады.
4.3 желісінде Zephyr 4.3.2 немесе одан кейінгі нұсқаға, немесе 4.5 желісінде 4.5.0 немесе одан кейінгі нұсқаға жаңартыңыз. Фактілерде жеткізуші түзету идентификаторы көрсетілмеген.
Түпнұсқа тақырып: Zephyr use-after-free and buffer leak in TCP header linearization
tcp_pkt_linearize() in subsys/net/ip/tcp.c is used by th_get() whenever a received TCP header is not contiguous in a single net_buf. While pulling the header bytes out of the following fragments, the loop called net_buf_unref() on an emptied fragment without first detaching its frags pointer. net_buf_unref() walks the whole fragment list, so the payload buffers still linked behind that fragment were freed as well, and the stale pointer was then reinstalled into the packet as buf->frags, producing a use-after-free and a later double free during packet teardown. The same loop also advanced to second->frags unconditionally: when the fragment still held payload after the header remainder was pulled, it was spliced out of the packet without ever being unreferenced, permanently leaking that buffer and silently dropping the data it carried. The defect is reached from tcp_recv() via th_get() on every received TCP segment, before connection lookup or any header validation, so a single unauthenticated segment that matches a listening socket is sufficient. An attacker only needs the TCP header to straddle a net_buf boundary, which they can arrange from off-link: IPv6 extension headers are accepted on receive and their length is added to the header offset by th_get(), so a Destination Options header of a suitable length places the TCP header across the boundary of the fixed-size receive buffers (CONFIG_NET_BUF_DATA_SIZE). Packet chains assembled from several sources - IPv4/IPv6 reassembly, 6LoWPAN/802.15.4 reassembly, tunnel or virtual interfaces that strip an outer header, or drivers producing scatter-gather chains - can additionally present a short interior fragment that the loop empties exactly, which is the case that frees the remainder of the packet while it is still in use. The reliably reachable consequence is exhaustion of the receive buffer pool: each crafted segment leaks one net_buf from the fixed CONFIG_NET_BUF_RX_COUNT pool, the buffers are never reclaimed, and once the pool is empty the device can no longer receive network traffic until it is rebooted. Where a fragment is emptied exactly, the impact rises to memory corruption: freed pool buffers are written through by the remainder of the loop, their contents may be delivered to the application, and the packet is double-freed on teardown. The fix saves and clears second->frags before the net_buf_unref() so only the emptied header fragment is released, and advances to the next fragment only when second->len == 0, keeping any fragment that still holds payload in the packet. This restores the detach-before-unref ownership pattern used elsewhere in the stack, for example in net_pkt_trim_buffer().