CVE-2022-50827
Description
In the Linux kernel, the following vulnerability has been resolved:
scsi: lpfc: Fix memory leak in lpfc_create_port()
Commit 5e633302ace1 ("scsi: lpfc: vmid: Add support for VMID in mailbox command") introduced allocations for the VMID resources in lpfc_create_port() after the call to scsi_host_alloc(). Upon failure on the VMID allocations, the new code would branch to the 'out' label, which returns NULL without unwinding anything, thus skipping the call to scsi_host_put().
Fix the problem by creating a separate label 'out_free_vmid' to unwind the VMID resources and make the 'out_put_shost' label call only scsi_host_put(), as was done before the introduction of allocations for VMID.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
CVE-2022 Linux kernel flaw where VMID resource allocation failures in lpfc driver create a memory leak by skipping scsi_host cleanup.
Root
Cause In the Linux kernel's Emulex lpfc SCSI driver, commit 5e633302ace1 added VMID (Virtual Machine ID) resource allocations inside lpfc_create_port(). These allocations occur after scsi_host_alloc(). If any VMID allocation fails, the allocation fails, the code jumps to an existing out label that returns NULL without releasing the previously allocated scsi_host structure, causing a memory leak [1].
Exploitation
Exploitation requires a trigger of VMID resource allocation failure within the lpfc driver. This can happen due to memory exhaustion or internal resource limits during port creation. An attacker with local access or the ability to influence driver initialization (e.g., via device hot-plug or module reload) could potentially cause repeated allocation failures, leading to gradual kernel memory depletion. No special privileges beyond those needed to trigger driver operations are indicated [1].
Impact
The memory leak leads to gradual depletion of kernel memory, potentially causing system instability, denial of service, or resource exhaustion for other processes. Over time, the system may become unresponsive or crash due to inability to allocate memory for critical operations [1].
Mitigation
The fix was applied in the Linux stable kernel branch (commit 9749595feb33a1a2b848800192224ffeed5346b4). It introduces a dedicated cleanup label out_free_vmid to release VMID resources before the existing out_put_shost label which correctly calls scsi_host_put(). Affected systems should apply the kernel update to prevent the leak [1].
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
39749595feb335ea1f195f51cdc8e483f684aVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
3News mentions
0No linked articles in our index yet.