CVE-2022-50481 cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
A null pointer dereference in the Linux kernel CXL driver can cause a system crash when device registration fails.
- 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-50481?
CVE-2022-50481 is a medium-severity vulnerability in Linux kernel, published on 4 Oct 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: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()
If device_register() fails in cxl_register_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device.
As comment of device_register() says, it should use put_device() to give up the reference in the error path. So split device_unregister() into device_del() and put_device(), then goes to put dev when register fails.
Weakness: CWE-476
Which versions are affected by CVE-2022-50481?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-50481?
Apply the vendor's patch.
Is CVE-2022-50481 being exploited?
There is no known exploitation of CVE-2022-50481 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-50481, GHSA-2fm3-57pq-4jp3, UBUNTU-CVE-2022-50481.