В ядре Linux устранена следующая уязвимость:
rust_binder: проверьте право собственности перед использованием vma
При установке отсутствующих страниц (или их удалении) Rust Binder будет выглядеть
поднимите виртуальную машину в мм по адресу, а затем вызовите vm_insert_page (или
zap_page_range_single). Однако, если vma закрыта и заменена на
другая vma по тому же адресу, это может привести к Rust Binder
установка страниц не в ту vma. Установив страницу в записываемую виртуальную машину, становится возможным писать
на ваши собственные страницы подшивки, которые обычно доступны только для чтения.
Хотя ты
не должен иметь возможности писать на эти страницы, цель, стоящая за
Дизайн Rust Binder таков, что даже если вы получите эту способность, она не должна
привести к чему-либо плохому. К сожалению, из-за другой ошибки это не так.
случай. Чтобы это исправить, сохраните указатель в vm_private_data и проверьте, что vma
возвращаемый vma_lookup(), имеет права vm_ops и vm_private_data раньше
пытаюсь использовать vma.
Это должно гарантировать, что Rust Binder откажется
для взаимодействия с любым другим VMA. Планируется ввести больше vma
абстракции, чтобы избежать этого небезопасного доступа к vm_ops и vm_private_data,
но сейчас давайте начнем с самого простого возможного решения. C Binder выполняет ту же проверку несколько другим способом: он
предоставляет vm_ops->close, который устанавливает логическое значение в true, а затем проверяет это
логическое значение после вызова vma_lookup(), но это более хрупко
чем решение в этом патче. (Наверное, мы все еще хотим сделать и то, и другое, но
обратный вызов vm_ops->close будет добавлен позже как часть последующих действий.
изменения API vma.)
Все еще можно переназначить vma, чтобы страницы отображались справа.
vma, но не с тем смещением, но это отдельная тема и будет
исправлено, когда Rust Binder получает обратный вызов vm_ops->close.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: rust_binder: check ownership before using vma When installing missing pages (or zapping them), Rust Binder will look up the vma in the mm by address, and then call vm_insert_page (or zap_page_range_single). However, if the vma is closed and replaced with a different vma at the same address, this can lead to Rust Binder installing pages into the wrong vma. By installing the page into a writable vma, it becomes possible to write to your own binder pages, which are normally read-only. Although you're not supposed to be able to write to those pages, the intent behind the design of Rust Binder is that even if you get that ability, it should not lead to anything bad. Unfortunately, due to another bug, that is not the case. To fix this, store a pointer in vm_private_data and check that the vma returned by vma_lookup() has the right vm_ops and vm_private_data before trying to use the vma. This should ensure that Rust Binder will refuse to interact with any other VMA. The plan is to introduce more vma abstractions to avoid this unsafe access to vm_ops and vm_private_data, but for now let's start with the simplest possible fix. C Binder performs the same check in a slightly different way: it provides a vm_ops->close that sets a boolean to true, then checks that boolean after calling vma_lookup(), but this is more fragile than the solution in this patch. (We probably still want to do both, but the vm_ops->close callback will be added later as part of the follow-up vma API changes.) It's still possible to remap the vma so that pages appear in the right vma, but at the wrong offset, but this is a separate issue and will be fixed when Rust Binder gets a vm_ops->close callback.
Характеристики атаки
Последствия
Строка CVSS v3.1
Уязвимые продукты 5
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
6.18.19
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
6.19.9
|
|
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:*:*:*:*:*:*
|
— | — |