В ядре Linux устранена следующая уязвимость:
модуль: распаковка: проверка возвращаемого значения модуля_extend_max_pages()
Module_extend_max_pages() внутренне вызывает kvrealloc() и возвращает результат.
-ENOMEM при сбое выделения. Возвращаемое значение никогда не проверяется. Если первоначальное выделение не удалось, info->pages остается NULL и
info->max_pages остается равным 0.
Последующие вызовы модуля_get_next_page()
попытается динамически увеличить массив, вызвав
Module_extend_max_pages(info, 0), так как info->used_pages равно 0. Это
приводит к тому, что kvrealloc(NULL, 0) возвращает ZERO_SIZE_PTR, что обрабатывается
как успех, что привело к разыменованию ZERO_SIZE_PTR и ядра
упс. Исправлено: добавьте отсутствующую проверку ошибок после модуля_extend_max_pages() и
немедленно вернуться в случае неудачи.
Это соответствует шаблону, используемому каждым
другой вызывающий объект kvrealloc() в пути загрузки модуля.
[Сами: Исправлен анализ в сообщении о фиксации.]
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: module: decompress: check return value of module_extend_max_pages() module_extend_max_pages() calls kvrealloc() internally and returns -ENOMEM on allocation failure. The return value is never checked. If the initial allocation fails, info->pages remains NULL and info->max_pages remains 0. Subsequent calls to module_get_next_page() will attempt to dynamically grow the array by calling module_extend_max_pages(info, 0) since info->used_pages is 0. This results in kvrealloc(NULL, 0) returning ZERO_SIZE_PTR, which is treated as a success, leading to a dereference of ZERO_SIZE_PTR and a kernel oops. Fix: add the missing error check after module_extend_max_pages() and return immediately on failure. This matches the pattern used by every other kvrealloc() caller in the module loading path. [Sami: Corrected the analysis in the commit message.]
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.17
|
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
|