CVE-2022-50742 in Linux
Summary
by MITRE • 12/24/2025
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.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 04/21/2026
The vulnerability identified as CVE-2022-50742 resides within the Linux kernel's OpenCAPI (ocxl) subsystem, specifically affecting the afu_ioctl() function implementation. This issue represents a reference counting leak that occurs during interrupt handler setup operations within the OpenCAPI acceleration framework. The ocxl driver facilitates communication between user-space applications and hardware accelerators through the OpenCAPI interface, which is commonly used in high-performance computing environments and data center applications. The flaw manifests when the ocxl_irq_set_handler function fails during the interrupt handling setup process, leaving a reference count improperly managed.
The technical root cause involves improper resource management within the kernel's eventfd subsystem integration. When the afu_ioctl() function attempts to set up interrupt handlers for OpenCAPI accelerators, it retrieves an eventfd context using eventfd_ctx_fdget() which increments the reference count. However, if the subsequent ocxl_irq_set_handler call fails, the corresponding eventfd_ctx_put() function is not invoked to decrement the reference count, resulting in a memory leak. This reference counting error directly violates proper kernel resource management principles and can lead to gradual memory exhaustion over time. The vulnerability operates at the kernel level within the device driver framework, making it particularly dangerous as it can affect system stability and performance.
The operational impact of this vulnerability extends beyond simple memory consumption issues, as it can compromise system reliability and availability. In production environments utilizing OpenCAPI accelerators, such as those found in high-performance computing clusters or specialized data processing systems, the reference count leak could accumulate over time and eventually lead to system instability or resource exhaustion. The vulnerability affects systems running Linux kernels that incorporate the affected ocxl driver code, particularly those implementing OpenCAPI hardware interfaces. Attackers could potentially exploit this weakness to perform resource exhaustion attacks, though the direct attack surface is limited to systems utilizing OpenCAPI accelerators and the specific ioctl interface.
Mitigation strategies for this vulnerability primarily involve applying the kernel patch that ensures eventfd_ctx_put() is called regardless of whether ocxl_irq_set_handler succeeds or fails. System administrators should prioritize updating their Linux kernel versions to include the fix, particularly in production environments where OpenCAPI accelerators are deployed. The fix aligns with established kernel development practices for proper resource management and follows the principle of least privilege in kernel code execution. Organizations should also implement monitoring for memory usage patterns that might indicate resource leaks, as this vulnerability could potentially be exploited in resource-constrained environments. Security teams should review their kernel update policies to ensure timely application of such patches, especially in critical infrastructure deployments. This vulnerability demonstrates the importance of thorough testing of error paths in kernel drivers and the critical nature of proper reference counting in kernel space programming. The fix addresses a fundamental flaw in the Linux kernel's device driver architecture that could have broader implications for similar reference counting issues in other kernel subsystems.