CVE-2022-49895 cxl/region: Fix decoder allocation crash
A NULL pointer dereference in the Linux kernel CXL region code allows local attackers to cause a system crash by exhausting port decoders.
- 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-49895?
CVE-2022-49895 is a medium-severity vulnerability in Linux kernel, published on 1 May 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:
cxl/region: Fix decoder allocation crash
When an intermediate port's decoders have been exhausted by existing regions, and creating a new region with the port in question in it's hierarchical path is attempted, cxl_port_attach_region() fails to find a port decoder (as would be expected), and drops into the failure / cleanup path.
However, during cleanup of the region reference, a sanity check attempts to dereference the decoder, which in the above case didn't exist. This causes a NULL pointer dereference BUG.
To fix this, refactor the decoder allocation and de-allocation into helper routines, and in this 'free' routine, check that the decoder, @cxld, is valid before attempting any operations on it.
Weakness: CWE-476
Which versions are affected by CVE-2022-49895?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-49895?
Apply the vendor's patch.
Is CVE-2022-49895 being exploited?
There is no known exploitation of CVE-2022-49895 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-49895, GHSA-vm29-jh4p-x8cp, UBUNTU-CVE-2022-49895.