CVE-2022-50742
Description
In the Linux kernel, the following vulnerability has been resolved:
misc: ocxl: fix possible refcount leak in afu_ioctl()
eventfd_ctx_put need to be called to put the refcount that gotten by eventfd_ctx_fdget when ocxl_irq_set_handler fails.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A reference count leak in the Linux kernel's ocxl driver can be triggered when ocxl_irq_set_handler fails, leading to a memory leak.
Vulnerability
CVE-2022-50742 is a reference count leak vulnerability in the Linux kernel's OpenCAPI (ocxl) driver. The issue resides in the afu_ioctl() function, where eventfd_ctx_fdget() is used to obtain a reference to an eventfd context. If the subsequent call to ocxl_irq_set_handler() fails, the code path does not release the previously acquired reference via eventfd_ctx_put(), causing the reference count to remain elevated indefinitely [1].
Exploitation
The vulnerability is triggered through a specific ioctl call on an ocxl device file. An attacker must have local access to the system and the ability to open an ocxl device, which typically requires root privileges or membership in the ocxl group. By sending a crafted ioctl that passes a valid eventfd file descriptor but causes ocxl_irq_set_handler() to fail, the refcount leak occurs. No additional authentication or network access is needed once local access to the device is obtained.
Impact
A successful exploitation results in a memory leak as the eventfd context object is never freed. Over time, repeated exploitation could exhaust kernel memory, potentially leading to a denial of service (system instability or crash). The vulnerability does not directly allow privilege escalation or code execution.
Mitigation
The vulnerability has been patched in the Linux kernel by adding the missing eventfd_ctx_put() call in the error path of afu_ioctl(). The fix is included in kernel versions 5.16.14 and later, and also backported to various stable branches [1][2]. Users are advised to update their kernels to a patched version. No workaround is available aside from restricting access to ocxl devices.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
6fc797285c40a7ba19a60c74f11bd8bbdf8f6843433a02e3466032c432916c3b69ba5114cVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- git.kernel.org/stable/c/11bd8bbdf8f6f5c1145bb158793107a57e3a1f07nvd
- git.kernel.org/stable/c/66032c43291672bae8b93184d2806f05be3e16dfnvd
- git.kernel.org/stable/c/7ba19a60c74fb0057d4daef2fa2cbfc9522f3ba1nvd
- git.kernel.org/stable/c/843433a02e344d30fbb62dfd834c60631baaa527nvd
- git.kernel.org/stable/c/c3b69ba5114c860d730870c03ab4ee45276e5e35nvd
- git.kernel.org/stable/c/fc797285c40a9cc441357abb3521d3e51c743f67nvd
News mentions
0No linked articles in our index yet.