CVE-2022-49504 scsi: lpfc: Inhibit aborts if external loopback plug is inserted

Medium 5.5 Published Updated

A use-after-free in the lpfc SCSI driver causes a system crash when removing an external loopback plug, leading to denial of service.

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

What is CVE-2022-49504?

CVE-2022-49504 is a medium-severity use after free vulnerability in Linux kernel, published on 26 Feb 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: Inhibit aborts if external loopback plug is inserted

After running a short external loopback test, when the external loopback is removed and a normal cable inserted that is directly connected to a target device, the system oops in the llpfc_set_rrq_active() routine.

When the loopback was inserted an FLOGI was transmit. As we're looped back, we receive the FLOGI request. The FLOGI is ABTS'd as we recognize the same wppn thus understand it's a loopback. However, as the ABTS sends address information the port is not set to (fffffe), the ABTS is dropped on the wire. A short 1 frame loopback test is run and completes before the ABTS times out. The looback is unplugged and the new cable plugged in, and the an FLOGI to the new device occurs and completes. Due to a mixup in ref counting the completion of the new FLOGI releases the fabric ndlp. Then the original ABTS completes and references the released ndlp generating the oops.

Correct by no-op'ing the ABTS when in loopback mode (it will be dropped anyway). Added a flag to track the mode to recognize when it should be no-op'd.

Which versions are affected by CVE-2022-49504?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2022-49504?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2022-49504 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as AZL-68624, DEBIAN-CVE-2022-49504, GHSA-2rh7-4r32-mrr5, ROOT-OS-DEBIAN-11-CVE-2022-49504, ROOT-OS-UBUNTU-2204-CVE-2022-49504, UBUNTU-CVE-2022-49504.

Is CVE-2022-49504 in your software?

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

Check your SBOMs for free