CVE-2022-49536: scsi: lpfc: Fix SCSI I/O completion and abort handler deadlock
In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Fix SCSI I/O completion and abort handler deadlock
During stress I/O tests with 500+ vports, hard LOCKUP call traces are observed.
CPU A: nativequeuedspinlockslowpath+0x192 rawspinlockirqsave+0x32 lpfchandlefcperr+0x4c6 lpfcfcpiocmdwqecmpl+0x964 lpfcsli4fphandlecqe+0x266 lpfcsli4processcq+0x105 lpfcsli4hbaprocesscq+0x3c lpfccqpollhdler+0x16 irqpollsoftirq+0x76 softirqentrytextstart+0xe4 irqexit+0xf7 doIRQ+0x7f
CPU B: nativequeuedspinlockslowpath+0x5b rawspinlock+0x1c lpfcaborthandler+0x13e scmdehaborthandler+0x85 processonework+0x1a7 workerthread+0x30 kthread+0x112 retfromfork+0x1f
Diagram of lockup:
CPUA CPUB ---- ---- lpfccmd->buflock phba->hbalock lpfccmd->buflock phba->hbalock
Fix by reordering the taking of the lpfccmd->buflock and phba->hbalock in lpfcaborthandler routine so that it tries to take the lpfccmd->buflock first before phba->hbalock.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.18.5-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.4-1Fixed in 7.3.5-1 - Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1019.23~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1019.24~20.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1017.23~20.04.2 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-48.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1015.20~20.04.2 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-48.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1017.22~20.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1018.21~20.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-47.51 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1019.23 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1019.24 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1017.23 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1015.18 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1002.4 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1013.15 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1015.20 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1017.21 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-47.53 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1007.7 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1017.22 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1014.16 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1020.20 - Compensating control
In the Linux kernel lpfc_abort_handler routine, acquire lpfc_cmd->buf_lock before phba->hbalock to avoid the SCSI I/O completion and abort-handler deadlock.
Event History
Frequently Asked Questions
What is the severity of CVE-2022-49536?
The severity of CVE-2022-49536 is considered high due to the potential for deadlock during SCSI I/O processing, leading to a system hard lockup.
How do I fix CVE-2022-49536?
To fix CVE-2022-49536, users should upgrade their Linux Kernel to a version greater than 5.15.46 or ensure they are on an unaffected version.
What systems are affected by CVE-2022-49536?
CVE-2022-49536 affects the Linux Kernel versions between 5.16 and 5.17.14, as well as versions between 5.18 and 5.18.3.
What causes the CVE-2022-49536 vulnerability?
CVE-2022-49536 is caused by a deadlock in the SCSI I/O completion and abort handler that manifests under stressful I/O conditions.
Is there a temporary workaround for CVE-2022-49536?
Currently, the best option is to upgrade the kernel as there are no reliable temporary workarounds available for CVE-2022-49536.