В ядре Linux устранена следующая уязвимость:
mm/damon/stat: ошибка освобождения damon_call(), утечка damon_ctx
damon_stat_start() всегда выделяет объект damon_ctx модуля.
(damon_stat_context). Между тем, если damon_call() в функции завершится неудачно,
объект damon_ctx не освобождается. Следовательно, если damon_call()
не удалось, и пользователь снова пишет Y для «включено», ранее
выделенный объект damon_ctx просочился.
Это невозможно исправить, просто освободив объект damon_ctx, когда
damon_call() завершается с ошибкой. Это потому, что ошибка damon_call() не гарантирует
основная функция kdamond, которая обращается к объекту damon_ctx,
полностью закончен. Другими словами, если damon_stat_start() освобождает
объект damon_ctx после сбоя damon_call(), еще не завершенный
kdamond может получить доступ к освобожденной памяти (использование после освобождения).
Устраните утечку, избегая при этом использования после освобождения, продолжая возвращать
damon_stat_start() без освобождения объекта damon_ctx после
сбой damon_call(), но его освобождение при вызове функции
снова, и kdamond полностью прекращается. Если кдамонда еще нет
прекращено, просто верните -EAGAIN, так как kdamond скоро будет прекращен. Проблема была обнаружена [1] пользователем sashiko.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: mm/damon/stat: deallocate damon_call() failure leaking damon_ctx damon_stat_start() always allocates the module's damon_ctx object (damon_stat_context). Meanwhile, if damon_call() in the function fails, the damon_ctx object is not deallocated. Hence, if the damon_call() is failed, and the user writes Y to “enabled” again, the previously allocated damon_ctx object is leaked. This cannot simply be fixed by deallocating the damon_ctx object when damon_call() fails. That's because damon_call() failure doesn't guarantee the kdamond main function, which accesses the damon_ctx object, is completely finished. In other words, if damon_stat_start() deallocates the damon_ctx object after damon_call() failure, the not-yet-terminated kdamond could access the freed memory (use-after-free). Fix the leak while avoiding the use-after-free by keeping returning damon_stat_start() without deallocating the damon_ctx object after damon_call() failure, but deallocating it when the function is invoked again and the kdamond is completely terminated. If the kdamond is not yet terminated, simply return -EAGAIN, as the kdamond will soon be terminated. The issue was discovered [1] by sashiko.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 10
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.17.1
|
6.18.23
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.13
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:-:*:*:*:*:*:*
|
— | — |
|
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:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:*
|
— | — |