The ITE IT8xxx2 SHI host-command backend in subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_shi_ite.c arms the SPI peripheral before its receive context exists. shi_ite_init_registers() sets the state machine to SHI_STATE_READY_TO_RECV and calls irq_enable() while the device initializes at POST_KERNEL priority CONFIG_KERNEL_INIT_PRIORITY_DEFAULT (40), but data->rx_ctx and data->tx are only assigned later by shi_ite_backend_init(), which ec_host_cmd_init() invokes at CONFIG_EC_HOST_CMD_INIT_PRIORITY (default 80). Если подключенный хост-процессор запускает транзакцию SPI внутри этого окна, прерывание Rx-valid-length срабатывает, shi_ite_int_handler() проходит проверку состояния и вызывает shi_ite_parse_header(), который хранит длину запроса, полученного от хоста, через все еще NULL data->rx_ctx. На IT8xxx2 низкие адреса не поддерживаются RAM, а с CONFIG_NULL_POINTER_EXCEPTION_DETECTION_PMP первые байты адресного пространства явно становятся недоступными, поэтому в магазине возникает фатальная ошибка доступа в контексте прерывания.
Окно расширяется, когда CONFIG_EC_HOST_CMD_INITIALIZE_AT_BOOT отключен, и приложение вызывает сам ec_host_cmd_init(). Результатом является паника ядра на встроенном контроллере: с фатальным обработчиком Zephyr's по умолчанию CPU останавливается, поэтому контроллер перестает обслуживать команды хоста до сброса оборудования. Поскольку триггером является трафик от подключенного хост-процессора - ненадежного узла с точки зрения прошивки контроллера - программное обеспечение на этом хосте может спровоцировать неисправность, заставляя сброс контроллера и выдавая транзакции во время перезагрузки, превращая восстанавливаемый сброс в постоянное отключение.
Воздействие ограничено доступностью: неисправный адрес фиксирован, а не выбран злоумышленником, поэтому не следует никакой примитивной коррупции памяти. Исправление оставляет интерфейс в SHI_STATE_DISABLED с прерыванием, замаскированным во время запуска устройства, перемещает irq_enable () в shi_ite_backend_init () после публикации буферов и заставляет shi_ite_int_handler () отклонить NULL data->rx_ctx при очистке записи IT83XX_SPI_ISR и IT83XX_SPI_RX_VLISR, так что неожиданное раннее прерывание не может штурмовать.
Показать оригинальное описание (EN)
The ITE IT8xxx2 SHI host-command backend in subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_shi_ite.c arms the SPI peripheral before its receive context exists. shi_ite_init_registers() sets the state machine to SHI_STATE_READY_TO_RECV and calls irq_enable() while the device initializes at POST_KERNEL priority CONFIG_KERNEL_INIT_PRIORITY_DEFAULT (40), but data->rx_ctx and data->tx are only assigned later by shi_ite_backend_init(), which ec_host_cmd_init() invokes at CONFIG_EC_HOST_CMD_INIT_PRIORITY (default 80). If the attached host processor starts a SPI transaction inside that window, the Rx-valid-length interrupt fires, shi_ite_int_handler() passes its state check and calls shi_ite_parse_header(), which stores the host-derived request length through the still-NULL data->rx_ctx. On the IT8xxx2 low addresses are not backed by RAM, and with CONFIG_NULL_POINTER_EXCEPTION_DETECTION_PMP the first bytes of the address space are explicitly made inaccessible, so the store raises a fatal access fault in interrupt context. The window widens further when CONFIG_EC_HOST_CMD_INITIALIZE_AT_BOOT is disabled and the application calls ec_host_cmd_init() itself. The result is a kernel panic on the embedded controller: with Zephyr's default fatal handler the CPU halts, so the controller stops servicing host commands until a hardware reset. Because the trigger is traffic from the attached host processor -- an untrusted peer from the controller firmware's point of view -- software on that host can provoke the fault by forcing a controller reset and issuing transactions during the reboot, turning a recoverable reset into a persistent outage. Impact is limited to availability: the faulting address is fixed and not attacker-chosen, so no memory-corruption primitive follows. The fix leaves the interface at SHI_STATE_DISABLED with the interrupt masked during device init, moves irq_enable() into shi_ite_backend_init() after the buffers are published, and makes shi_ite_int_handler() reject a NULL data->rx_ctx while write-clearing IT83XX_SPI_ISR and IT83XX_SPI_RX_VLISR so that an unexpected early interrupt cannot storm.
Характеристики атаки
Последствия
Строка CVSS v3.1