В ядре Linux была устранена следующая уязвимость: platform/x86: x86-android-планшеты: hold device reference for secondary fwnode teardown In gpio_secondary_fwnode_init(), acpi_bus_find_device_by_name() returns a device reference, но локальная переменная dev объявляется с помощью __free(put_device), отбрасывая ссылку в конце каждой итерминации. Между тем, devm_add_action_or_reset () сохраняет указатель dev для gpio_secondary_unset () без увеличения количества ссылок, что может привести к use-after-free во время разборки драйвера, если устройство будет выпущено в промежуточный период. Приобретите явную ссылку на устройство с get_device () при регистрации действия devres и отбросьте его с put_device () внутри gpio_secondary_unset ().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: platform/x86: x86-android-tablets: hold device reference for secondary fwnode teardown In gpio_secondary_fwnode_init(), acpi_bus_find_device_by_name() returns a device reference, but the local dev variable is declared with __free(put_device), dropping the reference at the end of each iteration. Meanwhile, devm_add_action_or_reset() saves the dev pointer for gpio_secondary_unset() without incrementing its reference count, which could lead to a use-after-free during driver teardown if the device is released in the interim. Acquire an explicit device reference with get_device() when registering the devres action, and drop it with put_device() inside gpio_secondary_unset().