В ядре Linux устранена следующая уязвимость:
ACPI: NFIT: core: исправлена ошибка очистки acpi_nfit_init(). Если acpi_nfit_init() завершается сбоем после добавления объекта acpi_desc в
acpi_descs, этот объект никогда не удаляется из этого списка, потому что
действие devm acpi_nfit_shutdown() не добавляется для устройства NFIT
в таком случае. Далее, сбой acpi_nfit_init() вызывает
acpi_nfit_probe() терпит неудачу, объект acpi_desc освобождается и
висячий указатель остался в файле acpi_descs.
Любое последующее
Исключение проверки машины ACPI вызовет nfit_handle_mce(), который
выполняет итерацию по acpi_descs, поэтому произойдет использование после освобождения. Более того, если acpi_nfit_probe() возвращает 0 после установки уведомления
обработчик для устройства NFIT и без выделения acpi_desc
объект и установка указателя данных драйвера устройства NFIT,
Объект acpi_desc будет выделен с помощью acpi_nfit_update_notify()
и acpi_nfit_init() будет вызван для его инициализации. Несмотря на это
того, произойдет ли сбой acpi_nfit_init() в этом случае,
Действие devm acpi_nfit_shutdown() не добавляется для устройства NFIT.
и acpi_desc никогда не удаляется из списка acpi_descs.
Если
Объект acpi_desc впоследствии освобождается при удалении драйвера, любой
последующий ACPI MCE приведет к использованию после освобождения, как в
предыдущий случай. Чтобы решить первую проблему, упомянутую выше, сделайте acpi_nfit_probe().
вызывать acpi_nfit_shutdown() непосредственно при сбоях acpi_nfit_init() и
чтобы обратиться к другому, добавьте обратный вызов удаления к драйверу и
вызовите acpi_nfit_shutdown(). Кроме того, поскольку теперь можно
передать NULL в acpi_nfit_shutdown() или переданный ему объект acpi_desc
возможно, не был инициализирован, добавьте проверки на NULL для acpi_desc и
его поле nvdimm_bus в эту функцию и сделайте acpi_nfit_unregister()
очистите последнее после отмены регистрации шины NVDIMM.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ACPI: NFIT: core: Fix acpi_nfit_init() error cleanup If acpi_nfit_init() fails after adding the acpi_desc object to the acpi_descs list, that object is never removed from that list because the acpi_nfit_shutdown() devm action is not added for the NFIT device in that case. Next, the acpi_nfit_init() failure causes acpi_nfit_probe() to fail, the acpi_desc object is freed, and a dangling pointer is left behind in the acpi_descs. Any subsequent ACPI Machine Check Exception will trigger nfit_handle_mce() which iterates over acpi_descs and so a use-after-free will occur. Moreover, if acpi_nfit_probe() returns 0 after installing a notify handler for the NFIT device and without allocating the acpi_desc object and setting the NFIT device's driver data pointer, the acpi_desc object will be allocated by acpi_nfit_update_notify() and acpi_nfit_init() will be called to initialize it. Regardless of whether or not acpi_nfit_init() fails in that case, the acpi_nfit_shutdown() devm action is not added for the NFIT device and acpi_desc is never removed from the acpi_descs list. If the acpi_desc object is freed subsequently on driver removal, any subsequent ACPI MCE will lead to a use-after-free like in the previous case. To address the first issue mentioned above, make acpi_nfit_probe() call acpi_nfit_shutdown() directly on acpi_nfit_init() failures and to address the other one, add a remove callback to the driver and make it call acpi_nfit_shutdown(). Also, since it is now possible to pass NULL to acpi_nfit_shutdown() or the acpi_desc object passed to it may not have been initialized, add checks against NULL for acpi_desc and its nvdimm_bus field to that function and make acpi_nfit_unregister() clear the latter after unregistering the NVDIMM bus.
Характеристики атаки
Последствия
Строка CVSS v3.1