В ядре Linux устранена следующая уязвимость:
drm: установить старый дескриптор в NULL перед простой заменой в Change_handle
В Change_handle возникла потенциальная гонка. ioctl
на короткое время имел один объект с двумя записями idr; одновременный
gem_close может удалить объект и удалить один из дескрипторов.
оставляя другой висеть, что впоследствии может
быть разыменован для использования после освобождения. Чтобы это исправить, проделайте тот же танец, что и сам драгоценный камень.
(f6cd7daecff5 drm: Освободите ссылки на драйверы для обработки, прежде чем снова сделать их доступными)
Сначала idr_replace старый дескриптор на NULL. Позже, если премьер
операции успешны, фактически закройте его.
Для create_tail потребовался аналогичный танец, чтобы избежать подобной проблемы.
(bd46cece51a3 drm/gem: исправлена гонка в drm_gem_handle_create_tail())
Он idr_allocs новый дескриптор со значением NULL, а затем заменяет правильный
возразите позже, чтобы избежать гонок. Нам не нужно этого делать здесь, поскольку
единственные операции, которые могут участвовать в гонках, — это drm_prime и
Change_handle удерживает основную блокировку в течение всего времени.
v2: очистка путей ошибок
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: drm: Set old handle to NULL before prime swap in change_handle There was a potential race condition in change_handle. The ioctl briefly had a single object with two idr entries; a concurrent gem_close could delete the object and remove one of the handles while leaving the other one dangling, which could subsequently be dereferenced for a use-after-free. To fix this, do the same dance that gem_close itself does. (f6cd7daecff5 drm: Release driver references to handle before making it available again) First idr_replace the old handle to NULL. Later, if the prime operations are successful, actually close it. create_tail required a similar dance to avoid a similar problem. (bd46cece51a3 drm/gem: Fix race in drm_gem_handle_create_tail()) It idr_allocs the new handle with NULL, then swaps in the correct object later to avoid races. We don't need to do that here, since the only operations that could race are drm_prime, and change_handle holds the prime lock for the entire duration. v2: cleanups of error paths
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 4
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
6.18.32
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.0.9
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*
|
— | — |