Zephyr
Zephyr SMSC911x Ethernet драйверіндегі буфер шегінен тыс жазу бір жергілікті желідегі шабуылдаушыға жүйеге кірмей-ақ құрылғыны істен шығаруға, көрші ядро деректерін бүлдіруге және басқару ағынына ықпал етуге мүмкіндік береді. Шабуылдаушы интерфейс MTU-ын көтеру үшін Router Advertisement жібереді, содан кейін драйвердің тұрақты жіберу буферінен үлкен кадрды жіберуді іске қосады.
Түйіндемені дереккөздер негізінде ЖИ жасаған және ол автоматты түрде аударылған.
SMSC911x/LAN9220 Ethernet драйверін пайдаланатын 1.14.0-ден 4.3.2-ге дейінгі және 4.4.0-ден 4.5.0-ге дейінгі Zephyr шығарылымдарына әсер етеді. 4.3.2 және 4.5.0 нұсқаларында түзетілген.
Көрші ядро жадына буфер шегінен тыс жазу, деректердің бүлінуіне, істен шығуға немесе басқару ағынына ықпал етуге әкеледі.
Түзетілген нұсқалар: 4.3.24.5.0
| zephyr | бастап 1.14.0 → түзетілді 4.3.2 бастап 4.4.0 → түзетілді 4.5.0 |
Әсер етілген шығарылым ауқымында SMSC911x/LAN9220 Ethernet драйвері (smsc,lan9220 түйіндері, мысалы, mps2/mps3/mps4 тақталары) бар Zephyr жұмыс істейтін командалар.
SMSC911x Ethernet драйвері өзінің буферінен үлкен кадрды жіберген кезде сахналық буферінің соңынан тыс жазады. Толып кету көрші ядро жадын бүлдіреді, бұл деректердің бүлінуіне, істен шығуға немесе басқару ағынына ықпал етуге әкелуі мүмкін.
Zephyr шығарылымдары 1.14.0-ден 4.3.2-ге дейін және 4.4.0-ден 4.5.0-ге дейін, SMSC911x/LAN9220 Ethernet драйверін пайдаланатын. Бұл ақау IPv6 фрагментациясы өшірулі болғанда орын алады, бұл әдепкі күй, сондықтан жіберуде MTU ұзындығын тексеру жоқ. Оқырман өз ағашындағы Zephyr нұсқасын және SMSC911x/LAN9220 драйверінің құрастыруға кіретінін тексере алады.
Егер 4.3 желісінде болсаңыз, Zephyr 4.3.2 нұсқасына, ал 4.4 желісінде болсаңыз, 4.5.0 нұсқасына жаңартыңыз.
Түпнұсқа тақырып: Zephyr out-of-bounds write in SMSC911x Ethernet driver
The SMSC911x/LAN9220 Ethernet driver stages every outgoing frame in a fixed-size static buffer before pushing it to the controller FIFO. eth_tx() in drivers/ethernet/eth_smsc911x.c took the frame length from net_pkt_get_len(pkt) and passed it directly to net_pkt_read(pkt, tx_buf, total_len), with no comparison against the size of tx_buf (NET_ETH_MAX_FRAME_SIZE). net_pkt_read() takes no destination size and only fails when the packet is shorter than the requested length, so any packet longer than the staging buffer was copied past its end. Nothing between the IP layer and the driver bounds the frame to what the link can carry: ethernet_send() in subsys/net/l2/ethernet/ethernet.c performs no length check, and the IPv6 output path only compares the packet against the interface MTU when CONFIG_NET_IPV6_FRAGMENT is enabled (it is disabled by default). The size the stack will build is therefore governed by the interface MTU, and that MTU is remotely settable: handle_ra_input() in subsys/net/ip/ipv6_nbr.c honours the MTU option of any Router Advertisement with a value up to 0xffff, gated only by the standard hop-limit-255 and link-local-source checks. An unauthenticated attacker on the same link can raise the MTU and then have the device emit a single frame of several kilobytes, for example as a TCP segment from any service that returns more than ~1.5 KB or as an oversized UDP datagram. The result is an out-of-bounds write into .bss immediately after tx_buf, with the overrun length and much of its content derived from the transmitted frame. Consequences range from corruption of adjacent kernel data and a crash to potential control-flow influence where the clobbered globals hold pointers; the practical overrun size is bounded by the network buffer pool rather than by the advertised MTU. The fix rejects frames larger than NET_ETH_MAX_FRAME_SIZE with -EMSGSIZE before any TX_DATA_PORT write, so the controller FIFO is also not left holding a command word without its payload.