CVE-2022-49534: scsi: lpfc: Protect memory leak for NPIV ports sending PLOGI_RJT
In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Protect memory leak for NPIV ports sending PLOGIRJT
There is a potential memory leak in lpfcignoreelscmpl() and lpfcelsrspreject() that was allocated from NPIV PLOGIRJT (lpfcrcvplogi()'s loginmbox).
Check if cmdiocb->contextun.mbox was allocated in lpfcignoreelscmpl(), and then free it back to phba->mboxmempool along with mbox->ctxbuf for service parameters.
For lpfcelsrspreject() failure, free both the ctxbuf for service parameters and the loginmbox.
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 - Compensating control
In lpfc_ignore_els_cmpl(), check whether cmdiocb->context_un.mbox was allocated and, if so, free it back to phba->mbox_mem_pool along with mbox->ctx_buf for service parameters. On lpfc_els_rsp_reject() failure, free the service-parameter ctx_buf and login_mbox.