В ядре Linux устранена следующая уязвимость:
gpio: исправлена утечка ресурсов из-за ошибок в gpiochip_add_data_with_key(). С момента фиксации aab5c6f20023 («gpio: установить тип устройства для чипов GPIO»),
`gdev->dev.release` не установлен. В результате количество ссылок на
`gdev->dev` не удаляется в путях обработки ошибок.
Киньте ссылку на ошибки. Также измените порядок инструкций, чтобы упростить обработку ошибок. Теперь gpiochip_add_data_with_key() примерно выглядит так:
>>> Некоторое распределение памяти.
При возникновении ошибок перейдите в ERR ZONE 1.
>>> device_initialize().
gpiodev_release() берет на себя ответственность за освобождение
ресурсы `gdev->dev`. Последующие пути обработки ошибок
не должен снова проходить через ERR ZONE 1, что приводит к двойному освобождению.
>>> Некоторая инициализация в основном на `gdev`.
>>> Остальная инициализация. При возникновении ошибок перейдите в ERR ZONE 2.
>>> Регистрация чипа успешная и выход.
>>> ERR ZONE 2. gpio_device_put() и выйдите.
>>> ЗОНА ОШИБКИ 1.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: gpio: Fix resource leaks on errors in gpiochip_add_data_with_key() Since commit aab5c6f20023 ("gpio: set device type for GPIO chips"), `gdev->dev.release` is unset. As a result, the reference count to `gdev->dev` isn't dropped on the error handling paths. Drop the reference on errors. Also reorder the instructions to make the error handling simpler. Now gpiochip_add_data_with_key() roughly looks like: >>> Some memory allocation. Go to ERR ZONE 1 on errors. >>> device_initialize(). gpiodev_release() takes over the responsibility for freeing the resources of `gdev->dev`. The subsequent error handling paths shouldn't go through ERR ZONE 1 again which leads to double free. >>> Some initialization mainly on `gdev`. >>> The rest of initialization. Go to ERR ZONE 2 on errors. >>> Chip registration success and exit. >>> ERR ZONE 2. gpio_device_put() and exit. >>> ERR ZONE 1.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 8
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.9
|
6.18.22
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.12
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:*
|
— | — |