Обработчик Syscall Time-aware GPIO z_vrfy_tgpio_pin_read_ts_ec() в drivers/timeaware_gpio/timeaware_gpio_handlers.c подтвердил только объект устройства порта и передал водителю метку времени и выходные указатели event_count без проверки K_SYSCALL_MEMORY_WRITE(). The other handlers in the same file (z_vrfy_tgpio_port_get_time(), z_vrfy_tgpio_port_get_cycles_per_second()) already performed that check, so the omission left one syscall unguarded. tgpio_pin_read_ts_ec() is declared __syscall, so with CONFIG_USERSPACE=y an unprivileged user-mode thread that has been granted access to the TGPIO device object can invoke it with arbitrary pointer values. tgpio_intel_read_ts_ec() in drivers/timeaware_gpio/timeaware_gpio_intel.c bounds-checks only the pin index and then unconditionally performs timestamp = ... and event_count = ..., executing two 8-byte stores in supervisor mode at addresses chosen by the user-mode caller. В результате получается примитив write-what-where, который пересекает границу пользовательского пространства / ядра: целевой адрес полностью выбран злоумышленником, а сохраненные значения - это содержимое регистра захвата времени аппаратного обеспечения и счетчика событий.
Коррумпирование структур данных ядра таким образом может привести к эскалации вызывающего потока до привилегии супервизора или сбою системы; требуемое разрешение устройства-объекта является узкой возможностью, которая не предназначена для предоставления доступа к памяти ядра. Исправление добавляет две недостающие проверки K_SYSCALL_MEMORY_WRITE () перед вызовом драйвера. Экспозиция на практике узкая.
Только сборки с CONFIG_USERSPACE=y и CONFIG_TIMEAWARE_GPIO=y компилируют затронутый файл, а начиная с v3.6.0 файл дополнительно ссылался на перемещенный заголовок (<zephyr/syscall_handler.h>) и удалял макросы Z_SYSCALL_*, поэтому такую конфигурацию не удалось создать, пока они не были восстановлены после v4.4.0. Деревья вниз по течению, которые локально исправили эту поломку, и v3.5.0 строят там, где его не было, являются подверженной популяцией.
Показать оригинальное описание (EN)
The Time-aware GPIO syscall verification handler z_vrfy_tgpio_pin_read_ts_ec() in drivers/timeaware_gpio/timeaware_gpio_handlers.c validated only the port device object and passed the caller-supplied timestamp and event_count output pointers to the driver without a K_SYSCALL_MEMORY_WRITE() check. The other handlers in the same file (z_vrfy_tgpio_port_get_time(), z_vrfy_tgpio_port_get_cycles_per_second()) already performed that check, so the omission left one syscall unguarded. tgpio_pin_read_ts_ec() is declared __syscall, so with CONFIG_USERSPACE=y an unprivileged user-mode thread that has been granted access to the TGPIO device object can invoke it with arbitrary pointer values. tgpio_intel_read_ts_ec() in drivers/timeaware_gpio/timeaware_gpio_intel.c bounds-checks only the pin index and then unconditionally performs timestamp = ... and event_count = ..., executing two 8-byte stores in supervisor mode at addresses chosen by the user-mode caller. The result is a write-what-where primitive that crosses the userspace/kernel boundary: the target address is fully attacker-chosen and the stored values are the hardware time-capture and event-counter register contents. Corrupting kernel data structures this way can escalate the calling thread to supervisor privilege or crash the system; the device-object permission required is a narrow capability that is not intended to confer any kernel-memory access. The fix adds the two missing K_SYSCALL_MEMORY_WRITE() validations before the driver call. Exposure is narrow in practice. Only builds with CONFIG_USERSPACE=y and CONFIG_TIMEAWARE_GPIO=y compile the affected file, and from v3.6.0 onward the file additionally referenced a relocated header (<zephyr/syscall_handler.h>) and removed Z_SYSCALL_* macros, so such a configuration failed to build until those were repaired after v4.4.0. Downstream trees that locally corrected that breakage, and v3.5.0 builds where it did not exist, are the exposed population.
Характеристики атаки
Последствия
Строка CVSS v3.1