ocxl: fix pci device refcount leak when calling get_function_0()
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().
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.10.163, 5.15.86, 6.0.16, 6.1.2
- CVEs
- CVE-2022-50337
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 7 Nov 2026, 11:33 UTC · Revision 1
Source evidence
ocxl: fix pci device refcount leak when calling get_function_0()
core-osv · Original sourcePublished 15 Sept 2025, 14:49 UTC
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().
osv:CVE-2022-50337
Kernel
Fixed versions: 5.10.163, 5.15.86, 6.0.16, 6.1.2
Complete source record
{
"id": "159691f85c7674ba43da8a69c7a73d889b8ee821c1b8a91a3de81cc4f081c1a2",
"url": "https://osv.dev/vulnerability/CVE-2022-50337",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "ocxl: fix pci device refcount leak when calling get_function_0()",
"summary": "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().",
"evidence": "osv:CVE-2022-50337",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.10.163",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.86",
"evidence": "/affected/1/ranges"
},
{
"value": "6.0.16",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.2",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2022-50337",
"aliases": [
"CVE-2022-50337"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "87db7579ebd5ded337056eb765542eb2608f16e3"
},
{
"fixed": "a40e1b0a922a53fa925ea8b296e3de30a31ed028"
},
{
"fixed": "37a13b274e4513c757e50c002ddcbf4bc89adbb2"
},
{
"fixed": "9a1b3148975b71fdc194e62612478346bbe618cd"
},
{
"fixed": "40ff4c2335a98f0ee96b099bfd70b8e6644f321f"
},
{
"fixed": "27158c72678b39ee01cc01de1aba6b51c71abe2f"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50337.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.9.0"
},
{
"fixed": "5.10.163"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.86"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.0.16"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.1.0"
},
{
"fixed": "6.1.2"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50337.json"
}
}
],
"modified": "2026-10-28T02:30:50.737265979Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/27158c72678b39ee01cc01de1aba6b51c71abe2f",
"https://git.kernel.org/stable/c/37a13b274e4513c757e50c002ddcbf4bc89adbb2",
"https://git.kernel.org/stable/c/40ff4c2335a98f0ee96b099bfd70b8e6644f321f",
"https://git.kernel.org/stable/c/9a1b3148975b71fdc194e62612478346bbe618cd",
"https://git.kernel.org/stable/c/a40e1b0a922a53fa925ea8b296e3de30a31ed028",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50337.json",
"https://nvd.nist.gov/vuln/detail/CVE-2022-50337",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50337.json"
}
},
"related_cves": [
{
"value": "CVE-2022-50337",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 519142,
"published_at": "2025-09-15T14:49:52.919+00:00"
}