В ядре Linux устранена следующая уязвимость: scsi: qla2xxx: Двойное завершение Avoid в async IOCB timeout qla2x00_async_iocb_timeout() пытается прервать тайм-аут async IOCB. Когда qla24xx_async_abort_cmd() терпит неудачу, как путь SRB_LOGIN_CMD, так и путь SRB_CTRL_VP/default сканируют outstanding_cmds[] для SRB, а затем вызывают sp->done(sp, QLA_FUNCTION_TIMEOUT) безоговорочно, без проверки того, действительно ли SRB был найден и удален. Если ответ ISR завершает ту же самую обработку, он удаляет SRB под qp_lock_ptr и запускает sp->done () -> complete(sp->comp).
Отправитель qla24xx_control_vp () просыпается из wait_for_completion (), очищает sp->comp, удаляет свою ссылку и возвращает, возвращая завершение на стеке. Ссылка на таймер сохраняет SRB живым в обработчике таймаута, но не в стеке отправителя. Затем тайм-аут выдает второй sp->done() -> qla_ctrlvp_sp_done(), который вычисляет «если (sp->comp) complete(sp->comp)»; с указателем, загруженным перед хранилищем NULL отправителя, complete() записывает в освобожденный стек фрейм, use-after-free.
Отслеживайте, удалял ли этот путь SRB из outstanding_cmds и вызывайте sp->done(), когда он это делал, поэтому команда выполняется ровно один раз, независимо от того, какой путь ей принадлежит. Это зеркальное отражение предохранителя sp_found, уже используемого в qla24xx_abort_iocb_timeout().
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: scsi: qla2xxx: Avoid double completion in async IOCB timeout qla2x00_async_iocb_timeout() tries to abort a timed-out async IOCB. When qla24xx_async_abort_cmd() fails, both the SRB_LOGIN_CMD path and the SRB_CTRL_VP/default path scan outstanding_cmds[] for the SRB and then call sp->done(sp, QLA_FUNCTION_TIMEOUT) unconditionally, without checking whether the SRB was actually found and removed. If the response ISR completes the same handle first, it removes the SRB under qp_lock_ptr and runs sp->done() -> complete(sp->comp). The submitter qla24xx_control_vp() wakes from wait_for_completion(), clears sp->comp, drops its reference and returns, reclaiming the on-stack completion. The timer reference keeps the SRB alive across the timeout handler, but not the submitter's stack. The timeout then issues a second sp->done() -> qla_ctrlvp_sp_done(), which evaluates "if (sp->comp) complete(sp->comp)"; with the pointer loaded before the submitter's NULL store, complete() writes into the freed stack frame, a use-after-free. Track whether this path removed the SRB from outstanding_cmds and only call sp->done() when it did, so the command is completed exactly once by whichever path owns it. This mirrors the sp_found guard already used in qla24xx_abort_iocb_timeout().
Характеристики атаки
Последствия
Строка CVSS v3.1