В ядре Linux устранена следующая уязвимость:
power: Supply: bq25980: исправлено использование после освобождения в power_supply_changed(). Использование варианта `devm_` для запроса IRQ _до_ `devm_`
вариант выделения/регистрации дескриптора `power_supply` означает, что
дескриптор `power_supply` будет освобожден/не зарегистрирован _до_
обработчик прерывания (поскольку `devm_` естественным образом освобождает память в обратном порядке)
порядок распределения). Это означает, что при удалении происходит гонка
состояние, при котором прерывание может сработать сразу после_ питания `power_supply`
дескриптор был освобожден, *но* только _перед_ соответствующим
была выполнена отмена регистрации обработчика IRQ.
Это приведет к тому, что обработчик IRQ вызовет `power_supply_changed()` с
освобожденный дескриптор power_supply. Что обычно приводит к сбою системы или
иначе молча портит память... Обратите внимание, что аналогичная ситуация может произойти и во время
`зонд()`; возможность срабатывания прерывания _до_ регистрации
дескриптор `power_supply`.
Тогда это приведет к неприятной ситуации
использования дескриптора `power_supply` *неинициализированного* в
`power_supply_changed()`. Исправьте это непристойное использование после освобождения, убедившись, что IRQ запрашивается _after_
регистрация дескриптора `power_supply`.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: power: supply: bq25980: Fix use-after-free in power_supply_changed() Using the `devm_` variant for requesting IRQ _before_ the `devm_` variant for allocating/registering the `power_supply` handle, means that the `power_supply` handle will be deallocated/unregistered _before_ the interrupt handler (since `devm_` naturally deallocates in reverse allocation order). This means that during removal, there is a race condition where an interrupt can fire just _after_ the `power_supply` handle has been freed, *but* just _before_ the corresponding unregistration of the IRQ handler has run. This will lead to the IRQ handler calling `power_supply_changed()` with a freed `power_supply` handle. Which usually crashes the system or otherwise silently corrupts the memory... Note that there is a similar situation which can also happen during `probe()`; the possibility of an interrupt firing _before_ registering the `power_supply` handle. This would then lead to the nasty situation of using the `power_supply` handle *uninitialized* in `power_supply_changed()`. Fix this racy use-after-free by making sure the IRQ is requested _after_ the registration of the `power_supply` handle.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 7
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.10
|
5.10.252
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.202
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.165
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.128
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.75
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.14
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.4
|