В ядре Linux устранена следующая уязвимость:
прошивка: stratix10-rsu: исправлено отключение значения NULL для тайм-аута rsu_send_msg() в зонде.
rsu_send_msg() может вернуть -ETIMEDOUT, когда
wait_for_completion_interruptible_timeout() срабатывает, пока вызов SMC все еще продолжается
в ожидании. В stratix10_rsu_probe() пути ошибок для COMMAND_RSU_DCMF_VERSION,
COMMAND_RSU_DCMF_STATUS, COMMAND_RSU_MAX_RETRY и COMMAND_RSU_GET_SPT_TABLE
вызов stratix10_svc_free_channel(), который устанавливает chan->scl в NULL, но затем
провалиться и поставить следующий запрос в очередь на том же канале. Следующий СВК
Запускаемый kthread будет разыменовывать pdata->chan->scl в обратном вызове приема.
путь, вызывая разыменование NULL-указателя, идентичного тому, который зафиксирован
commit c45f7263100c («прошивка: stratix10-rsu: исправить разыменование нулевого указателя
когда RSU отключен") для пути COMMAND_RSU_STATUS.
Примените тот же шаблон очистки к остальным путям сбоя: удалите
асинхронного клиента, освободите канал и вернитесь раньше, чтобы дальнейшие сообщения не поступали.
поставлен в очередь на канале, scl которого очищен. При этом очистите stratix10_rsu_probe() двумя способами, не меняя
поведение:
- Отбросьте избыточную инициализацию нулями полей, уже очищенных
devm_kzalloc(): client.receive_cb, status.* и spt0/1_address
(INVALID_SPT_ADDRESS — 0x0).
- Замените пять одинаковых трехстрочных блоков очистки ошибок.
(stratix10_svc_remove_async_client() + stratix10_svc_free_channel() +
return ret) с метками перехода (remove_async_client, free_channel),
соответствие стандартному шаблону высвобождения ресурсов ядра и создание его
проще расширить последовательность зондов, не забывая о сопоставлении
уборка. Также переместите init_completion() рядом с mutex_init(), чтобы синхронизировать примитив.
инициализация сгруппирована перед всем, что может вызвать
обратный вызов.
---
v2: Добавьте небольшую очистку функции stratix10_rsu_probe(), чтобы иметь
централизовать выход для всех rsu_send_async_msg() и rsu_send_msg().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: firmware: stratix10-rsu: Fix NULL deref on rsu_send_msg() timeout in probe rsu_send_msg() can return -ETIMEDOUT when wait_for_completion_interruptible_timeout() fires while the SMC call is still pending. In stratix10_rsu_probe(), the error paths for COMMAND_RSU_DCMF_VERSION, COMMAND_RSU_DCMF_STATUS, COMMAND_RSU_MAX_RETRY and COMMAND_RSU_GET_SPT_TABLE call stratix10_svc_free_channel() - which sets chan->scl to NULL - but then fall through and queue the next request on the same channel. The next svc kthread that runs will dereference pdata->chan->scl in its receive callback path, triggering a NULL pointer dereference identical to the one fixed by commit c45f7263100c ("firmware: stratix10-rsu: Fix NULL pointer dereference when RSU is disabled") for the COMMAND_RSU_STATUS path. Apply the same cleanup pattern to the remaining failure paths: remove the async client, free the channel, and return early so no further messages are queued on a channel whose scl has been cleared. While at it, clean up stratix10_rsu_probe() in two ways without changing behavior: - Drop redundant zero-initialization of fields already cleared by devm_kzalloc(): client.receive_cb, status.* and spt0/1_address (INVALID_SPT_ADDRESS is 0x0). - Replace five identical 3-line error-cleanup blocks (stratix10_svc_remove_async_client() + stratix10_svc_free_channel() + return ret) with goto labels (remove_async_client, free_channel), matching the standard kernel resource-unwinding pattern and making it easier to extend the probe sequence without forgetting matching cleanup. Also move init_completion() next to mutex_init() so sync-primitive initialization is grouped before anything that could trigger a callback. --- v2: Add a minor clean-up of the function stratix10_rsu_probe() to have a centralize exit for all the rsu_send_async_msg() and rsu_send_msg().
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 8
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.0.13
|
|
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:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc6:*:*:*:*:*:*
|
— | — |
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:7.1:rc7:*:*:*:*:*:*
|
— | — |