В ядре Linux была устранена следующая уязвимость: scsi: libsas: Fix SMP IO deadlock Во время HA resume smp_execute_task_sg() вызывает pm_runtime_get_sync() на хосте перед выдачей команды SMP. Когда эта команда сама выдается из пути резюме HA, тупики get_sync (): он ждет текущего резюме (устройство RPM_RESUMING), в то время как резюме блокируется в sas_drain_work (), ожидая того же SMP IO для завершения. Для выхода из тупика нужен диск SATA, прикрепленный к экспандеру.
Во время sas_resume_ha() -> sas_drain_work(), DISCE_RESUME -> sas_resume_sata() -> ata_sas_port_resume() запрашивает ATA_EH_RESET, и жесткий сброс для такого диска выполняется через SMP PHY CONTROL (sas_ata_hard_reset() -> sas_phy_reset() -> sas_smp_phy_control() -> smp_execute_task_sg()). Direct-attached SATA сбрасывает через lldd_control_phy() и SSP устройства используют TMFs, поэтому ни один из них не попадает в это. Замените пару get_sync()/put_sync() на pm_runtime_get_noresume()/pm_runtime_put(). smp_execute_task_sg() нужно только задержать автосуспенд, пока SMP находится в полете, и он не должен пытаться возобновить хост: синхронизированное резюме, выпущенное из самого пути резюме HA, - это то, что тупики, и к тому времени, когда sas_resume_ha() запускается, hw_init уже перезапускает аппаратное обеспечение.
Ссылка на использование по-прежнему требуется. Работа обнаружения обычно выполняется внутри ссылки PM работника события, взятой в sas_notify_port_event() время уведомления и удерживается до тех пор, пока обработчик не смыл очередь дискотеки. sas_rediscover_ex_phy() однако требует DISCE_REVALIDATE_DOMAIN от самого работника перепроверки, и flush_workqueue() не ждет рабочих элементов, стоящих в очереди во время выполнения, так что цепная перепроверка выполняется без внешней ссылки PM - без get_noresume(), его гонка SMP. Для пути BSG sas_smp_handler() является единственным вызывающим абонентом, который может найти хост автоподвешенным: запросы экспандера SMP не проходят ни через одну очередь запросов устройства SCSI, поэтому ничто другое на этом пути не заставляет хост бодрствовать.
Возобновите его там с помощью pm_runtime_resume_and_get () и проверьте результат.
Показать оригинальное описание (EN)
In the Linux kernel, the following vulnerability has been resolved: scsi: libsas: Fix SMP IO deadlock during HA resume smp_execute_task_sg() calls pm_runtime_get_sync() on the host before issuing an SMP command. When that command is itself issued from the HA resume path, the get_sync() deadlocks: it waits for the ongoing resume (the device is RPM_RESUMING), while the resume is blocked in sas_drain_work() waiting for that same SMP IO to complete. The deadlock needs an expander-attached SATA disk. During sas_resume_ha() -> sas_drain_work(), DISCE_RESUME -> sas_resume_sata() -> ata_sas_port_resume() requests ATA_EH_RESET, and the hard reset for such a disk is done via SMP PHY CONTROL (sas_ata_hard_reset() -> sas_phy_reset() -> sas_smp_phy_control() -> smp_execute_task_sg()). Direct-attached SATA resets through lldd_control_phy() and SSP devices use TMFs, so neither hits this. Replace the get_sync()/put_sync() pair with pm_runtime_get_noresume()/pm_runtime_put(). smp_execute_task_sg() only needs to hold off autosuspend while the SMP is in flight, and it must not try to resume the host: a sync resume issued from the HA resume path itself is what deadlocks, and by the time sas_resume_ha() runs, hw_init has already reinitialized the hardware, so the device is accessible without one. The usage reference is still required. Discovery work normally runs inside an event worker's PM reference, taken at sas_notify_port_event() notify time and held until the handler has flushed the disco queue. sas_rediscover_ex_phy() however requeues DISCE_REVALIDATE_DOMAIN from within the revalidation worker itself, and flush_workqueue() does not wait for work items queued during execution, so that chained revalidation runs with no outer PM reference - without the get_noresume(), its SMP could race autosuspend. For the BSG path, sas_smp_handler() is the only caller which may find the host autosuspended: expander SMP requests do not go through any SCSI device request queue, so nothing else in that path holds the host awake. Resume it there with pm_runtime_resume_and_get() and check the result.
Уязвимые продукты 7
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.1.183
|
6.1.191
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.6.151
|
6.6.161
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.12.103
|
6.12.115
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
6.18.44
|
6.18.59
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.2
|
7.2.13
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.2
|
7.3
|
|
Linux Linux_Kernel
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
|
7.1.8
|
— |