В ядре Linux устранена следующая уязвимость:
crypto: acomp — исправить неверный указатель, сохраненный в acomp_save_req()
acomp_save_req() сохраняет цепочку &req->в req->base.data. Когда
acomp_reqchain_done() вызывается при асинхронном завершении, он получает
&req->chain в качестве аргумента данных, но приводит его непосредственно к структуре
acomp_req. Поскольку данные указывают на члена цепочки, все последующие поля
доступ осуществляется по неправильному смещению, что приводит к повреждению памяти.
Проблема возникает, когда асинхронная аппаратная реализация, например
драйвер QAT выполняет запрос, использующий виртуальный адрес DMA
интерфейс (например, acomp_request_set_src_dma()). Эта комбинация вызывает
crypto_acomp_compress() для ввода пути acomp_do_req_chain(), который
устанавливает acomp_reqchain_done() в качестве обратного вызова завершения через
acomp_save_req(). При включенном KASAN это проявляется как общая неисправность защиты в
acomp_reqchain_done():
общая ошибка защиты, вероятно, для неканонического адреса 0xe000040000000000
КАСАН: вероятно доступ к пользовательской памяти в диапазоне [0x0000400000000000-0x0000400000000007]
RIP: 0010:acomp_reqchain_done+0x15b/0x4e0
Отслеживание вызова:
<IRQ>
qat_comp_alg_callback+0x5d/0xa0 [intel_qat]
adf_ring_response_handler+0x376/0x8b0 [intel_qat]
adf_response_handler+0x60/0x170 [intel_qat]
Tasklet_action_common+0x223/0x820
handle_softirqs+0x1ab/0x640
</IRQ>
Исправьте это, сохранив сам запрос в req->base.data вместо
&req->chain, чтобы acomp_reqchain_done() получила правильный указатель.
Упростите acomp_restore_req(), чтобы получить прямой доступ к цепочке req->.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: crypto: acomp - fix wrong pointer stored by acomp_save_req() acomp_save_req() stores &req->chain in req->base.data. When acomp_reqchain_done() is invoked on asynchronous completion, it receives &req->chain as the data argument but casts it directly to struct acomp_req. Since data points to the chain member, all subsequent field accesses are at a wrong offset, resulting in memory corruption. The issue occurs when an asynchronous hardware implementation, such as the QAT driver, completes a request that uses the DMA virtual address interface (e.g. acomp_request_set_src_dma()). This combination causes crypto_acomp_compress() to enter the acomp_do_req_chain() path, which sets acomp_reqchain_done() as the completion callback via acomp_save_req(). With KASAN enabled, this manifests as a general protection fault in acomp_reqchain_done(): general protection fault, probably for non-canonical address 0xe000040000000000 KASAN: probably user-memory-access in range [0x0000400000000000-0x0000400000000007] RIP: 0010:acomp_reqchain_done+0x15b/0x4e0 Call Trace: <IRQ> qat_comp_alg_callback+0x5d/0xa0 [intel_qat] adf_ring_response_handler+0x376/0x8b0 [intel_qat] adf_response_handler+0x60/0x170 [intel_qat] tasklet_action_common+0x223/0x820 handle_softirqs+0x1ab/0x640 </IRQ> Fix this by storing the request itself in req->base.data instead of &req->chain, so that acomp_reqchain_done() receives the correct pointer. Simplify acomp_restore_req() accordingly to access req->chain directly.
Характеристики атаки
Последствия
Строка CVSS v3.1
Тип уязвимости (CWE)
Уязвимые продукты 2
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.16
|
6.18.27
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.19
|
7.0.4
|