CVE-2022-50165 in Linuxinfo

Summary

by MITRE • 06/18/2025

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

wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()`

Commit 7a4836560a61 changes simple_write_to_buffer() with memdup_user() but it forgets to change the value to be returned that came from simple_write_to_buffer() call. It results in the following warning:

warning: variable 'rc' is uninitialized when used here [-Wuninitialized]
return rc; ^~

Remove rc variable and just return the passed in length if the memdup_user() succeeds.

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

Analysis

by VulDB Data Team • 12/01/2025

The vulnerability CVE-2022-50165 resides within the Linux kernel's wireless driver subsystem, specifically affecting the wil6210 wireless interface driver. This issue manifests as an uninitialized variable usage that occurs during debugfs file operations, representing a classic software defect that can potentially lead to unpredictable behavior or system instability. The wil6210 driver is responsible for managing wireless communication hardware, and its debugfs interface provides developers and system administrators with diagnostic capabilities for troubleshooting wireless connectivity issues.

The technical flaw stems from a code modification that replaced simple_write_to_buffer() with memdup_user() function call within the wil_write_file_wmi() function. While the replacement was intended to improve memory handling and security by properly copying user-space data, the implementation failed to properly update all variable references that were previously dependent on the simple_write_to_buffer() return value. The commit 7a4836560a61 introduced this regression by maintaining the original variable rc that was supposed to capture the return value from the function call, but this variable remained uninitialized when the function attempted to return it.

This uninitialized variable scenario creates a condition where the return code rc could contain arbitrary memory contents from the stack, leading to unpredictable program behavior and potentially exploitable conditions. The compiler warning indicates that the variable is used without initialization, which violates fundamental programming practices and can result in execution flow being altered based on garbage data. Such issues are particularly concerning in kernel space code where incorrect return values can cause system crashes, data corruption, or privilege escalation vulnerabilities.

The operational impact of this vulnerability extends beyond simple system instability, as it affects the reliability of wireless debugging operations within the kernel. When the debugfs interface is accessed to write wireless management interface data, the uninitialized return value could cause the driver to behave erratically or fail completely, potentially disrupting wireless connectivity for devices using the wil6210 chipset. This vulnerability aligns with CWE-457, which describes the use of uninitialized variables, and could potentially be leveraged by attackers to gain unauthorized access to kernel memory or manipulate wireless communication parameters.

The fix implemented addresses this issue by removing the problematic rc variable entirely and replacing it with a direct return of the length parameter when memdup_user() succeeds. This approach eliminates the uninitialized variable risk while maintaining the intended functionality of the debugfs interface. The mitigation strategy follows established security practices by avoiding complex variable handling in kernel code and ensuring all return values are properly initialized before use. This remediation approach aligns with the principle of least privilege and secure coding standards, preventing potential attackers from exploiting uninitialized memory contents to manipulate kernel execution flow, thus maintaining the integrity of the wireless subsystem and overall system stability.

Responsible

Linux

Reservation

06/18/2025

Disclosure

06/18/2025

Moderation

accepted

CPE

ready

EPSS

0.00198

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!