В ядре Linux устранена следующая уязвимость:
mm/damon/core: удалить call_control в неактивных контекстах
Если damon_call() выполняется в контексте DAMON, который не запущен,
функция возвращает ошибку, сохраняя объект damon_call_control
связан со списком call_controls контекста. Предположим, что объект
освобождается после damon_call(), и еще один damon_call()
выполняется в том же контексте. Функция пытается добавить новый
damon_call_control в список call_controls, который все еще имеет
указатель на предыдущий объект damon_call_control, который освобожден.
В результате происходит использование после освобождения. На самом деле это можно запустить с помощью интерфейса DAMON sysfs. Это не
легко эксплуатировать, поскольку для этого требуется разрешение sysfs на запись и создание
правда, пишет определенно странный файл.
Пожалуйста, обратитесь к отчету для
подробнее об этапах воспроизведения выпуска. Исправьте проблему, внеся два изменения. Во-первых, переместите финал
kdamond_call() для отмены всех существующих запросов damon_call() от
завершение контекста DAMON должно быть выполнено до сброса ctx->kdamond.
Это
делает любой код, который видит NULL ctx->kdamond, может безопасно принять контекст
может больше не получать доступ к запросам damon_call(). Во-вторых, пусть damon_call()
для очистки объектов damon_call_control, которые были добавлены в
уже завершенный контекст DAMON, прежде чем вернуть ошибку.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: mm/damon/core: remove call_control in inactive contexts If damon_call() is executed against a DAMON context that is not running, the function returns error while keeping the damon_call_control object linked to the context's call_controls list. Let's suppose the object is deallocated after the damon_call(), and yet another damon_call() is executed against the same context. The function tries to add the new damon_call_control object to the call_controls list, which still has the pointer to the previous damon_call_control object, which is deallocated. As a result, use-after-free happens. This can actually be triggered using the DAMON sysfs interface. It is not easily exploitable since it requires the sysfs write permission and making a definitely weird file writes, though. Please refer to the report for more details about the issue reproduction steps. Fix the issue by making two changes. Firstly, move the final kdamond_call() for cancelling all existing damon_call() requests from terminating DAMON context to be done before the ctx->kdamond reset. This makes any code that sees NULL ctx->kdamond can safely assume the context may not access damon_call() requests anymore. Secondly, let damon_call() to cleanup the damon_call_control objects that were added to the already-terminated DAMON context, before returning the error.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 10
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.17.1
|
6.18.7
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.17:-:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc2:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc5:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc7:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:6.19:rc8:*:*:*:*:*:*
|
— | — |