CVE-2022-50337 ocxl: fix pci device refcount leak when calling get_function_0()
A reference count leak in the Linux kernel ocxl driver can lead to resource exhaustion and 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-50337?
CVE-2022-50337 is a medium-severity vulnerability in Linux kernel, published on 15 Sep 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:
ocxl: fix pci device refcount leak when calling get_function_0()
get_function_0() calls pci_get_domain_bus_and_slot(), as comment says, it returns a pci device with refcount increment, so after using it, pci_dev_put() needs be called.
Get the device reference when get_function_0() is not called, so pci_dev_put() can be called in the error path and callers unconditionally. And add comment above get_dvsec_vendor0() to tell callers to call pci_dev_put().
Which versions are affected by CVE-2022-50337?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2022-50337?
Apply the vendor's patch.
Is CVE-2022-50337 being exploited?
There is no known exploitation of CVE-2022-50337 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as DEBIAN-CVE-2022-50337, GHSA-p8q7-6g9r-q34g, UBUNTU-CVE-2022-50337.