В ядре Linux устранена следующая уязвимость:
rust_binder: правильно обрабатывает объекты FDA нулевой длины. Исправлена ошибка, из-за которой пустой объект FDA (массив fd) с 0 fds вызывал
ошибка выхода за пределы. Предыдущая реализация использовала `skip == 0` для
означает «это исправление указателя», но 0 также является правильной длиной пропуска
для пустого FDA.
Если FDA находится в конце буфера, то это
приводит к попытке записать 8 байтов за пределы. Это поймано и
приводит к возврату ошибки EINVAL в пользовательское пространство. Шаблон использования `skip == 0` в качестве специального значения берет свое начало из
C-реализация Binder.
В рамках исправления этой ошибки этот шаблон заменено перечислением Rust. Я рассмотрел альтернативный вариант: не вносить исправления, когда длина равно нулю, но я думаю, что проще просто избавиться от нуля, являющегося особенным. вещи. Основная причина этой ошибки была диагностирована Gemini CLI с первой попытки. я использовал следующую подсказку: > Кажется, в @drivers/android/binder/thread.rs есть ошибка, из-за которой > ошибка Fixups oob запускается с номером 316 304 316 324.
Это подразумевает > что мы каким-то образом исправили ситуацию, когда буфер A имеет указатель на > буфер B, но указатель находится по индексу в буфере A, который > за пределами. Пожалуйста, изучите код, чтобы найти ошибку. Вы можете > сравните с @drivers/android/binder.c, который реализует это правильно.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: rust_binder: correctly handle FDA objects of length zero Fix a bug where an empty FDA (fd array) object with 0 fds would cause an out-of-bounds error. The previous implementation used `skip == 0` to mean "this is a pointer fixup", but 0 is also the correct skip length for an empty FDA. If the FDA is at the end of the buffer, then this results in an attempt to write 8-bytes out of bounds. This is caught and results in an EINVAL error being returned to userspace. The pattern of using `skip == 0` as a special value originates from the C-implementation of Binder. As part of fixing this bug, this pattern is replaced with a Rust enum. I considered the alternate option of not pushing a fixup when the length is zero, but I think it's cleaner to just get rid of the zero-is-special stuff. The root cause of this bug was diagnosed by Gemini CLI on first try. I used the following prompt: > There appears to be a bug in @drivers/android/binder/thread.rs where > the Fixups oob bug is triggered with 316 304 316 324. This implies > that we somehow ended up with a fixup where buffer A has a pointer to > buffer B, but the pointer is located at an index in buffer A that is > out of bounds. Please investigate the code to find the bug. You may > compare with @drivers/android/binder.c that implements this correctly.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 9
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18
|
6.18.10
|
|
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:*:*:*:*:*:*
|
— | — |