В ядре Linux устранена следующая уязвимость:
iio: gyro: itg3200: исправить чтение i2c в неправильном месте стека
itg3200_read_all_channels() принимает `__be16 *buf' в качестве параметра и
заполняет пункт назначения i2c_msg как `(char *)&buf'. Поскольку `buf' - это
параметр (указатель), `&buf' — адрес локального указателя
слот в стеке itg3200_read_all_channels(), а не адрес
буфера сканирования вызывающего абонента. Приведение (char *) скрывает тип
несоответствие.
Поэтому i2c_transfer() записывает ITG3200_SCAN_ELEMENTS * sizeof(s16)
= 8 байт в слот стека параметра, который отбрасывается при
функция возвращает значение. Буфер сканирования вызывающего абонента в
itg3200_trigger_handler() никогда не записывается, поэтому
iio_push_to_buffers_with_timestamp() помещает неинициализированный стек
содержимое в пространство пользователя через /dev/iio:deviceX при каждом сканировании – оба
Функциональная ошибка (отсутствуют фактические данные гироскопа или температуры).
доставка через триггерный буфер) и утечка информации. Небуферизованный путь read_raw() не затрагивается: он проходит
itg3200_read_reg_s16(), который использует `&out' для локального значения s16,
где это правильно.
Отбросьте ложный `&', чтобы чтение i2c записывало в вызывающую сторону буфер.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: iio: gyro: itg3200: fix i2c read into the wrong stack location itg3200_read_all_channels() takes `__be16 *buf' as a parameter and fills the i2c_msg destination as `(char *)&buf'. Since `buf' is the parameter (a pointer), `&buf' is the address of the local pointer slot on the stack of itg3200_read_all_channels(), not the address of the caller's scan buffer. The (char *) cast hides the type mismatch. i2c_transfer() therefore writes ITG3200_SCAN_ELEMENTS * sizeof(s16) = 8 bytes into the parameter's stack slot, which is discarded when the function returns. The caller's scan buffer in itg3200_trigger_handler() is never written to, so iio_push_to_buffers_with_timestamp() pushes uninitialised stack contents to userspace via /dev/iio:deviceX every scan -- both a functional bug (no actual gyroscope or temperature data is delivered through the triggered buffer) and an information leak. The non-buffered read_raw() path is unaffected: it goes through itg3200_read_reg_s16() which uses `&out' on a local s16 value, where that is correct. Drop the spurious `&' so the i2c read writes into the caller's buffer.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 12
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
3.9
|
5.10.259
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.11
|
5.15.210
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
5.16
|
6.1.176
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.2
|
6.6.143
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.7
|
6.12.93
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.13
|
6.18.35
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.0.12
|
|
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:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc3:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc4:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc5:*:*:*:*:*:*
|
— | — |