Драйвер контроллера Synopsys DesignWare I3C (drivers/i3c/i3c_dw.c) отслеживает свободные слоты Device Address Table (DAT) с помощью get_free_pos (), который сигнализирует об исчерпанной таблице, возвращая -1. Помощник объявил свой тип возврата как uint8_t, поэтому часовой был усечен до 255, и оба потребителя (dw_i3c_attach_device() и dw_i3c_i2c_attach_device()) также хранили его в uint8_t перед тестированием if (pos < 0) — сравнение, которое никогда не верно для неподписанного значения. Изнурительный страж был поэтому инертен в каждой постройке.
With the guard defeated, an attach attempted on a full DAT proceeds with pos == 255: it writes data->dw_i3c_i2c_priv_data[255].id, more than 200 bytes past the end of the 32-element dw_i3c_i2c_priv_data array and past the end of struct dw_i3c_data; it stores the resulting out-of-bounds address in desc->controller_priv, from which later detach, reattach and IBI operations read the slot index back; and it performs a 32-bit MMIO store 1020 bytes beyond the hardware DAT base, outside the table the controller reports. Присоединение по-прежнему возвращает успех, поэтому верхний слой считает, что устройство связано. DAT меньше, чем программный массив (его глубина читается из DEVICE_ADDR_TABLE_POINTER, обычно 8 или 16 записей), поэтому исчерпание доступно.
В двухрольной сборке (CONFIG_I3C_DUAL_ROLE с CONFIG_I3C_USE_IBI), выступающей в качестве вторичного контроллера, количество подключений обеспечивается активным контроллером шины: i3c_sec_handoffed () присоединяет одно устройство на вход принятого списка DEFTGTS, поэтому враждебный или неисправный контроллер на локальной шине I3C, который объявляет больше целей, чем локальная глубина DAT, запускает условие один раз на избыточный вход. Исчерпание также может быть достигнуто с дерева устройств, которое объявляет больше устройств, чем удерживает таблица, или с помощью повторяющихся команд i3c attach shell. Воздействие ограничено: хранилище out-of-bounds представляет собой единый байт фиксированного значения при фиксированном смещении, без выбранных злоумышленником данных или смещения, поэтому реалистичными результатами являются повреждение соседнего статического состояния драйвера, запись в зарезервированные регистры контроллера и непоследовательная бухгалтерия драйвера (авария или вклиненная шина I3C), а не управляемый примитив для записи в память.
Вектор атаки — локальная шина chip-to-chip I3C; нет пути, доступного по сети.
Показать оригинальное описание (EN)
The Synopsys DesignWare I3C controller driver (drivers/i3c/i3c_dw.c) tracks free Device Address Table (DAT) slots with get_free_pos(), which signals an exhausted table by returning -1. The helper declared its return type as uint8_t, so the sentinel was truncated to 255, and both consumers (dw_i3c_attach_device() and dw_i3c_i2c_attach_device()) also stored it in a uint8_t before testing if (pos < 0) — a comparison that is never true for an unsigned value. The exhaustion guard was therefore inert in every build. With the guard defeated, an attach attempted on a full DAT proceeds with pos == 255: it writes data->dw_i3c_i2c_priv_data[255].id, more than 200 bytes past the end of the 32-element dw_i3c_i2c_priv_data array and past the end of struct dw_i3c_data; it stores the resulting out-of-bounds address in desc->controller_priv, from which later detach, reattach and IBI operations read the slot index back; and it performs a 32-bit MMIO store 1020 bytes beyond the hardware DAT base, outside the table the controller reports. The attach still returns success, so the upper layer believes the device is bound. The DAT is smaller than the software array (its depth is read from DEVICE_ADDR_TABLE_POINTER, commonly 8 or 16 entries), so exhaustion is reachable. In a dual-role build (CONFIG_I3C_DUAL_ROLE with CONFIG_I3C_USE_IBI) acting as a secondary controller, the attach count is supplied by the bus's active controller: i3c_sec_handoffed() attaches one device per entry of the received DEFTGTS list, so a hostile or malfunctioning controller on the local I3C bus that declares more targets than the local DAT depth triggers the condition once per surplus entry. Exhaustion can also be reached from a devicetree that declares more devices than the table holds, or by repeated i3c attach shell commands. Impact is bounded: the out-of-bounds store is a single byte of fixed value at a fixed displacement, with no attacker-chosen data or offset, so the realistic outcomes are corruption of neighbouring static driver state, writes into reserved controller registers, and inconsistent driver bookkeeping (a crash or a wedged I3C bus) rather than a controllable memory-write primitive. The attack vector is the local chip-to-chip I3C bus; there is no network-reachable path.
Характеристики атаки
Последствия
Строка CVSS v3.1