В ядре Linux устранена следующая уязвимость:
drm/i915/dmc: исправлено маловероятное отклонение от NULL-указателя при проверке.
intel_dmc_update_dc6_allowed_count() не работает, когда DMC не был
инициализирован, и dmc, таким образом, имеет значение NULL. Это будет тот случай, когда путь вызова
intel_power_domains_init_hw() -> {skl,bxt,icl}_display_core_init() ->
gen9_set_dc_state() -> intel_dmc_update_dc6_allowed_count(), как
intel_power_domains_init_hw() вызывается *до* intel_dmc_init(). Однако gen9_set_dc_state() вызывает intel_dmc_update_dc6_allowed_count().
условно, в зависимости от текущего и целевого состояний ДК.
На зонде,
цель отключена, но если DC6 включен, функция вызывается,
и следует ой. Видимо весьма маловероятно, что DC6 включен
при пробе, поскольку мы раньше не видели такого режима отказа. Также странно включать DC6 при загрузке, поскольку для этого потребуется
прошивка DMC (загружается через BIOS); BIOS загружает прошивку DMC и
драйвер остановки/перепрограммирования прошивки плохо указан
последовательность и, как таковая, маловероятно преднамеренное поведение BIOS.
Это больше
вероятно, BIOS оставляет непреднамеренно включенное аппаратное состояние DC6
сзади (фактически не загружая необходимую для этого прошивку DMC). Отслеживание разрешенного счетчика DC6 работает только при запуске/
остановка счетчика зависит от состояния _SW_ DC6 по сравнению с текущим _HW_
Состояние DC6 (поскольку для остановки счетчика требуется, чтобы счетчик DC5 захватил
когда счетчик был запущен). Таким образом, использование состояния HW DC6 неверно.
и это также приводит к вышеупомянутому упс.
Устраните обе проблемы с помощью ПО DC6. состояние для отслеживания. Это версия 2 исправления, первоначально отправленного Джани, обновленная на основе первая ссылка: обсуждение ниже. (вишня выбрана из коммита 2344b93af8eb5da5d496b4e0529d35f0f559eaf0)
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: drm/i915/dmc: Fix an unlikely NULL pointer deference at probe intel_dmc_update_dc6_allowed_count() oopses when DMC hasn't been initialized, and dmc is thus NULL. That would be the case when the call path is intel_power_domains_init_hw() -> {skl,bxt,icl}_display_core_init() -> gen9_set_dc_state() -> intel_dmc_update_dc6_allowed_count(), as intel_power_domains_init_hw() is called *before* intel_dmc_init(). However, gen9_set_dc_state() calls intel_dmc_update_dc6_allowed_count() conditionally, depending on the current and target DC states. At probe, the target is disabled, but if DC6 is enabled, the function is called, and an oops follows. Apparently it's quite unlikely that DC6 is enabled at probe, as we haven't seen this failure mode before. It is also strange to have DC6 enabled at boot, since that would require the DMC firmware (loaded by BIOS); the BIOS loading the DMC firmware and the driver stopping / reprogramming the firmware is a poorly specified sequence and as such unlikely an intentional BIOS behaviour. It's more likely that BIOS is leaving an unintentionally enabled DC6 HW state behind (without actually loading the required DMC firmware for this). The tracking of the DC6 allowed counter only works if starting / stopping the counter depends on the _SW_ DC6 state vs. the current _HW_ DC6 state (since stopping the counter requires the DC5 counter captured when the counter was started). Thus, using the HW DC6 state is incorrect and it also leads to the above oops. Fix both issues by using the SW DC6 state for the tracking. This is v2 of the fix originally sent by Jani, updated based on the first Link: discussion below. (cherry picked from commit 2344b93af8eb5da5d496b4e0529d35f0f559eaf0)