Zephyr
Драйвер контроллера Zephyr DesignWare I3C записывает данные за пределы своего командного буфера, когда прямой запрос CCC указывает более 16 целевых устройств. Локальный низкопривилегированный поток пользовательского режима, имеющий доступ к устройству контроллера I3C, может вызвать это в сборках с включённым пользовательским режимом, что приводит к повреждению памяти ядра и потенциально к повышению привилегий или отказу в обслуживании.
Резюме сгенерировано ИИ по данным источников и переведено автоматически.
Затрагивает Zephyr с 4.1.0 по 4.3.2 и с 4.4.0 по 4.5.0 в сборках с CONFIG_USERSPACE, использующих драйвер DesignWare I3C. Исправлено в 4.3.2 и 4.5.0.
Непривилегированный поток может повредить память ядра, что может привести к повышению привилегий или отказу в обслуживании.
Исправлено в версиях: 4.3.24.5.0
| zephyr | с 4.1.0 → исправлено в 4.3.2 с 4.4.0 → исправлено в 4.5.0 |
Команды, поставляющие Zephyr с 4.1.0 до версии ниже 4.3.2 или 4.4.x до версии ниже 4.5.0 с драйвером Synopsys DesignWare I3C и включённым CONFIG_USERSPACE.
Прямой CCC, адресующий более 16 целевых устройств, заставляет драйвер Synopsys DesignWare I3C записывать дескрипторы команд за пределы буфера. В рекомендации говорится, что непривилегированный поток может повредить память ядра, что может привести к повышению привилегий или отказу в обслуживании.
Zephyr с 4.1.0 по 4.3.2 и с 4.4.0 по 4.5.0, в сборках с включённым CONFIG_USERSPACE, которые отправляют прямой CCC более чем 16 целям через драйвер DesignWare I3C. Для проверки смотрите используемую версию Zephyr и установлен ли CONFIG_USERSPACE в конфигурации сборки.
Обновитесь до Zephyr 4.3.2 для линейки 4.1 и 4.3 или до 4.5.0 для линейки 4.4. В фактах не указаны идентификаторы исправлений от вендора или обходные пути.
Оригинальный заголовок: Zephyr out-of-bounds write in DesignWare I3C driver CCC handling
The Synopsys DesignWare I3C controller driver (drivers/i3c/i3c_dw.c) builds one command descriptor per target when issuing a direct CCC in dw_i3c_do_ccc(). It stored payload->targets.num_targets in xfer->ncmds and filled xfer->cmds[i] for every target without checking the count against the size of the cmds[] array (DW_I3C_MAX_CMD_BUF_SIZE, 16 entries). A direct CCC with more than 16 targets wrote command descriptors past the end of struct dw_i3c_xfer, which is embedded in the driver's per-instance struct dw_i3c_data. i3c_do_ccc() is a system call. On builds with CONFIG_USERSPACE, a user-mode thread that has been granted access to the I3C controller device can supply the payload. In released versions the z_vrfy_i3c_do_ccc() handler only checked that the caller's target array was accessible user memory and placed no upper bound on num_targets; the driver therefore performed the out-of-bounds writes in supervisor mode. The only requirement for each target is an address the controller already knows (the same address may be repeated), and the writes happen before any bus transaction. The overflowing descriptors contain values the caller largely controls (data length, defining byte, CCC id, a user buffer pointer and transfer lengths). They overwrite the rest of the driver data, including the device-index table, the deftgts_work work item and device pointer when both controller and target roles are enabled, and any memory that follows. This lets an unprivileged thread corrupt kernel memory, which can lead to privilege escalation or denial of service. In-kernel callers in the tree only issue single-target direct CCCs, so builds without CONFIG_USERSPACE are only exposed to their own application code.