В ядре Linux была устранена следующая уязвимость: ACPI: шинная функция Introduce acpi_bus_get_primary_device() The, используемая для получения первого устройства «physical», для которого данный ACPI является компаньоном ACPI, acpi_get_first_physical_node(), может возвращать устаревший указатель устройства (в основном теоретически), потому что acpi_unbind_one() может работать в целом после удаления ACPI устройства physical_node_lock в acpi_get_first_physical_node() и до его возвращения. Последняя ссылка на устройство "physical" может быть отброшена до того, как указатель на него будет возвращен вызывающему абоненту. Если это произойдет, и вызов acpi_get_first_physical_node() вызовет get_device() на указателе, полученном от него, что делается большинством его вызовов, произойдет use-after-free.
Чтобы подготовиться к решению этой проблемы, введите новую функцию для получения первого устройства «physical», связанного с данным устройством ACPI («первичное физическое устройство»), которое также будет ссылаться на количество рассматриваемого устройства, прежде чем возвращать указатель на него. Сделайте эту новую функцию, и acpi_get_first_physical_node () разделит код поиска физического узла. Отсутствие преднамеренного функционального воздействия.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: ACPI: bus: Introduce acpi_bus_get_primary_device() The function used for obtaining the first "physical" device for which the given ACPI one is the ACPI companion, acpi_get_first_physical_node(), may return a stale device pointer (mostly in theory) because acpi_unbind_one() may run as a whole after dropping the ACPI device's physical_node_lock in acpi_get_first_physical_node() and before it returns. The last reference to the "physical" device may be dropped then before the pointer to it is returned to the caller. If that happens and the acpi_get_first_physical_node() caller invokes get_device() on the pointer obtained from it, which is done by the majority of its callers, a use-after-free will occur. To prepare for addressing this problem, introduce a new function for getting the first "physical" device associated with the given ACPI one (the "primary physical device") that will also reference count the device in question before returning a pointer to it. Make that new function and acpi_get_first_physical_node() share the physical node list lookup code. No intentional functional impact.