В ядре Linux устранена следующая уязвимость:
HID: lg-g15: отменить ожидающую работу по удалению, чтобы исправить использование после освобождения
lg_g15_data выделяется с помощью devm и содержит рабочий элемент. Отчет
расписание обработчиков, которое работает прямо с ввода устройства.
lg_g15_event() и lg_g15_v2_event() делают это с помощью клавиши цикла подсветки,
и lg_g510_leds_event() тоже это делает. Рабочий разыгрывает
lg_g15_data обратно через контейнер_of.
У драйвера не было обратного вызова удаления, и он никогда не отменял работу. Итак, если
отчет запланировал работу, а затем клавиатура была отключена, деврес
освободил lg_g15_data, пока работа еще не завершена или выполнялась, и
рабочий прикоснулся к освобожденной памяти. Это использование после бесплатного использования.
Это достижимо как гонка по отключению устройства. Добавьте обратный вызов удаления, который отменяет работу до того, как Деврес освободит государство. g15->работа инициализируется только для тех моделей, которые ее планируют (G15, G15 v2, G510). G13 и Z-10 оставляют его обнулённым, поэтому берегите отмените g15->work.func, чтобы избежать отмены работы, которая никогда не была установлена вверх.
Тест g15 NULL отражает тот, который уже есть в lg_g15_raw_event().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: HID: lg-g15: cancel pending work on remove to fix a use-after-free lg_g15_data is allocated with devm and holds a work item. The report handlers schedule that work straight from device input. lg_g15_event() and lg_g15_v2_event() do it on the backlight cycle key, and lg_g510_leds_event() does it too. The worker dereferences the lg_g15_data back through container_of. The driver had no remove callback and never cancelled the work. So if a report scheduled the work and the keyboard was then unplugged, devres freed lg_g15_data while the work was still pending or running, and the worker touched freed memory. This is a use-after-free. It is reachable as a race on device unplug. Add a remove callback that cancels the work before devres frees the state. g15->work is only initialized for the models that schedule it (G15, G15 v2, G510). The G13 and Z-10 leave it zeroed, so guard the cancel on g15->work.func to avoid cancelling a work that was never set up. The g15 NULL test mirrors the one already in lg_g15_raw_event().
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 9
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.5
|
5.10.261
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.212
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.178
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.145
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.96
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.39
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.1.4
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.2:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.2:rc2:*:*:*:*:*:*
|
— | — |