CVE-2022-50643 in Linuxinfo

Summary

by MITRE • 12/09/2025

In the Linux kernel, the following vulnerability has been resolved:

cifs: Fix xid leak in cifs_copy_file_range()

If the file is used by swap, before return -EOPNOTSUPP, should free the xid, otherwise, the xid will be leaked.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 03/28/2026

The vulnerability identified as CVE-2022-50643 represents a critical resource management flaw within the Linux kernel's Common Internet File System (CIFS) implementation. This issue specifically affects the cifs_copy_file_range() function which is responsible for copying file data between CIFS shares. The vulnerability manifests when attempting to copy file ranges where the source file is actively being used by the system's swap mechanism, creating a scenario where kernel resources become improperly managed. The flaw stems from inadequate cleanup procedures in error handling paths, where the function fails to properly release allocated resources before returning an error code.

The technical root cause of this vulnerability lies in the improper handling of transaction identifiers within the CIFS subsystem. Transaction identifiers serve as unique markers for network operations between client and server in CIFS implementations, and their proper management is essential for maintaining system stability and resource availability. When the cifs_copy_file_range() function encounters a situation where a file is in use by swap, it should return -EOPNOTSUPP to indicate that the operation is not supported. However, the implementation fails to free the transaction identifier before this return occurs, resulting in a resource leak that can accumulate over time and potentially lead to system instability.

This memory leak directly impacts system reliability and can contribute to broader security concerns within kernel space operations. The improper resource management creates a condition where transaction identifiers remain allocated even after the operation should have completed, leading to gradual depletion of available transaction resources. The vulnerability is particularly concerning in environments where CIFS operations are frequent or where systems may be under memory pressure, as the accumulation of leaked transaction identifiers can eventually impact system performance and potentially create denial of service conditions.

The operational impact of this vulnerability extends beyond simple resource consumption, as it represents a failure in proper kernel resource lifecycle management that can have cascading effects on system stability. When transaction identifiers leak, they consume kernel memory and can eventually exhaust available transaction slots, preventing legitimate CIFS operations from completing successfully. This issue aligns with CWE-404, which addresses improper resource release or cleanup, and demonstrates the importance of proper error handling in kernel code. The vulnerability affects systems running Linux kernels that implement the CIFS filesystem functionality, particularly those that frequently utilize swap space or perform file copy operations across CIFS mounts.

Mitigation strategies for this vulnerability require immediate kernel updates to address the resource management flaw in the CIFS subsystem. System administrators should prioritize applying the relevant security patches that correct the transaction identifier cleanup routine in the cifs_copy_file_range() function. Additionally, monitoring systems for signs of resource exhaustion or unusual CIFS operation behavior can help detect potential exploitation of this vulnerability. The fix ensures that transaction identifiers are properly freed regardless of the execution path taken by the function, thereby preventing the accumulation of leaked resources that could eventually impact system stability and performance. This remediation aligns with ATT&CK technique T1070.004, which involves the manipulation of existing system processes to avoid detection while maintaining persistent access through proper resource management practices.

Responsible

Linux

Reservation

12/09/2025

Disclosure

12/09/2025

Moderation

accepted

CPE

ready

EPSS

0.00199

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!