VYPR
Unrated severityNVD Advisory· Published Dec 9, 2025· Updated Apr 15, 2026

CVE-2022-50642

CVE-2022-50642

Description

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

platform/chrome: cros_ec_typec: zero out stale pointers

cros_typec_get_switch_handles allocates four pointers when obtaining type-c switch handles. These pointers are all freed if failing to obtain any of them; therefore, pointers in port become stale. The stale pointers eventually cause use-after-free or double free in later code paths. Zeroing out all pointer fields after freeing to eliminate these stale pointers.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A use-after-free/double-free vulnerability in the Linux kernel's Chrome OS Type-C driver caused by stale pointers after partial memory allocation failure.

Vulnerability

Description

In the Linux kernel's cros_ec_typec driver, the function cros_typec_get_switch_handles allocates four pointers when obtaining Type-C switch handles. If any of these allocations fail, all previously allocated pointers are freed, but the freed pointer values remain in the port structure. These stale pointers can later be dereferenced or freed again in other code paths, leading to use-after-free or double-free conditions [1].

Exploitation

An attacker who can trigger a partial allocation failure in the kernel's memory subsystem or influence the behavior of the Type-C hardware interface could cause the driver to leave stale pointers. The vulnerability is reachable through normal Type-C hotplug operations and does not require special privileges beyond physical access or the ability to manipulate USB-C connections [2].

Impact

Successful exploitation can result in kernel memory corruption, leading to a denial of service (system crash) or potentially arbitrary code execution with kernel privileges. The double-free scenario is particularly dangerous as it can be leveraged for privilege escalation from unprivileged user contexts.

Mitigation

The fix, introduced in Linux kernel version 6.2-rc1 and backported to various stable releases, zeros out all pointer fields after freeing them in cros_typec_get_switch_handles, preventing stale pointers from being used. Users are advised to apply the latest kernel updates from their distribution.

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

2
  • Linux/Kernelinferred2 versions
    (expand)+ 1 more
    • (no CPE)
    • (no CPE)range: not specified

Patches

4

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.