CVE-2022-50457
Linux Kernel vulnerability analysis and mitigation

Overview

CVE-2022-50457 is a vulnerability discovered in the Linux kernel affecting the Memory Technology Device (MTD) subsystem. The issue was published on October 1, 2025, and involves a refcount error in the delmtddevice() function (NVD, RedHat).

Technical details

The vulnerability stems from an incorrect sequence of operations in the delmtddevice() function. Specifically, the function calls memset(&mtd->dev, 0) before calling ofnodeput(), which clears the mtd->dev.ofnode pointer before it can be properly dereferenced. This results in ofnodeput() receiving a NULL pointer, causing it to skip the necessary reference count decrease operation. The issue manifests as a reference counting error where the expected refcount should be 1 but remains at 2, indicating an unbalanced ofnodeget()/ofnode_put() pair (RedHat). The vulnerability has been assigned a CVSS v3.1 base score of 5.5 with the vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H (RedHat).

Impact

The primary impact of this vulnerability is a memory leak in the system due to the improper reference counting. When triggered, it results in an error message indicating 'OF: ERROR: memory leak, expected refcount 1 instead of 2, ofnodeget()/ofnodeput() unbalanced' (NVD).

Mitigation and workarounds

The issue has been resolved by modifying the delmtddevice() function to cache the pointer of the device_node before clearing the device structure with memset. This ensures proper reference counting and prevents the memory leak (NVD).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-40343MEDIUM6.4
  • Linux KernelLinux Kernel
  • linux-riscv
NoYesDec 09, 2025
CVE-2025-40342MEDIUM6.4
  • Linux KernelLinux Kernel
  • linux-azure-5.4
NoYesDec 09, 2025
CVE-2025-40341MEDIUM5.1
  • Linux KernelLinux Kernel
  • kernel-debug-uki-virt-addons
NoYesDec 09, 2025
CVE-2025-40345N/AN/A
  • Linux KernelLinux Kernel
  • bpftool
NoYesDec 12, 2025
CVE-2025-40344N/AN/A
  • Linux KernelLinux Kernel
  • rtla
NoYesDec 09, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management