CVE-2022-50827 scsi: lpfc: Fix memory leak in lpfc_create_port()

Not scored Published Updated

A memory leak in the Linux kernel lpfc driver allows local attackers to cause a denial of service by exhausting system memory.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2022-50827?

CVE-2022-50827 is a memory corruption vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Which versions are affected by CVE-2022-50827?

How do I fix CVE-2022-50827?

Apply the vendor's patch.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2022-50827 being exploited?

There is no known exploitation of CVE-2022-50827 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2022-50827, GHSA-6pw2-377m-5mj9, UBUNTU-CVE-2022-50827.

Is CVE-2022-50827 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free