# CVE-2022-50161: mtd: maps: Fix refcount leak in of\_flash\_probe\_versatile

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **Published:** 2025-06-18T11:03:17.091Z
- **Modified:** 2026-06-17T05:22:53.003Z

## Who should check

- Anyone running Linux \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 3c8de6a838b7e0eb392754ac89dd66e698684342; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 79e57889aa0d92a6d769bad808fb105e7b6ea495; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 9124d51e01232a91da4034768a2a8d1688472179; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 52ae2b14f76ef2d490337ddc0037bc37125be7b8; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 4d67c8f74d804b20febf716ec96e9a475457ec60; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 5d5ddd8771fa9cabeb247fba5f6ab60d63f3fbce; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< f516fbb63873ee23cba5b7c3d239677c30f13df8; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 33ec82a6d2b119938f26e5c8040ed5d92378eb54
- Anyone running Linux 4.7

## Description

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

mtd: maps: Fix refcount leak in of\_flash\_probe\_versatile

of\_find\_matching\_node\_and\_match() returns a node pointer with refcount
incremented, we should use of\_node\_put() on it when not need anymore.
Add missing of\_node\_put() to avoid refcount leak.

## Affected and fixed versions

- Linux: \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 3c8de6a838b7e0eb392754ac89dd66e698684342; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 79e57889aa0d92a6d769bad808fb105e7b6ea495; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 9124d51e01232a91da4034768a2a8d1688472179; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 52ae2b14f76ef2d490337ddc0037bc37125be7b8; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 4d67c8f74d804b20febf716ec96e9a475457ec60; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 5d5ddd8771fa9cabeb247fba5f6ab60d63f3fbce; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< f516fbb63873ee23cba5b7c3d239677c30f13df8; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 33ec82a6d2b119938f26e5c8040ed5d92378eb54 (cvelist)
- Linux: 4.7 (cvelist)

## Mitigation

- Upgrade Linux to 33ec82a6d2b119938f26e5c8040ed5d92378eb54 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50161. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50161.md
Affected: Linux >= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, < 3c8de6a838b7e0eb392754ac89dd66e698684342; >= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, < 79e57889aa0d92a6d769bad808fb105e7b6ea495; >= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, < 9124d51e01232a91da4034768a2a8d1688472179; >= b0afd44bc192ff4c0e90a5f…
Fixed in: Linux 3c8de6a838b7e0eb392754ac89dd66e698684342, Linux 79e57889aa0d92a6d769bad808fb105e7b6ea495, Linux 9124d51e01232a91da4034768a2a8d1688472179, Linux 52ae2b14f76ef2d490337ddc0037bc37125be7b8, Linux 4d67c8f74d804b20febf716ec96e9a475457ec60, Linux 5d5ddd8771fa9cabeb247fba5f6ab60d63f3fbce, Linux 33ec8…

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50161 being exploited?

There is no confirmed exploitation: CVE-2022-50161 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50161?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-50161?

Linux \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 3c8de6a838b7e0eb392754ac89dd66e698684342; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 79e57889aa0d92a6d769bad808fb105e7b6ea495; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 9124d51e01232a91da4034768a2a8d1688472179; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 52ae2b14f76ef2d490337ddc0037bc37125be7b8; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 4d67c8f74d804b20febf716ec96e9a475457ec60; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 5d5ddd8771fa9cabeb247fba5f6ab60d63f3fbce; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< f516fbb63873ee23cba5b7c3d239677c30f13df8; \>= b0afd44bc192ff4c0e90a5fc1724350bcfc32b33, \< 33ec82a6d2b119938f26e5c8040ed5d92378eb54; Linux 4.7.

### Is there a fix for CVE-2022-50161?

Yes. Fixed in Linux 3c8de6a838b7e0eb392754ac89dd66e698684342, Linux 79e57889aa0d92a6d769bad808fb105e7b6ea495, Linux 9124d51e01232a91da4034768a2a8d1688472179, Linux 52ae2b14f76ef2d490337ddc0037bc37125be7b8, Linux 4d67c8f74d804b20febf716ec96e9a475457ec60, Linux 5d5ddd8771fa9cabeb247fba5f6ab60d63f3fbce, Linux 33ec82a6d2b119938f26e5c8040ed5d92378eb54. Upgrade Linux to 33ec82a6d2b119938f26e5c8040ed5d92378eb54 or later.

### How do I check if I'm affected by CVE-2022-50161?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/3c8de6a838b7e0eb392754ac89dd66e698684342>
- patch: <https://git.kernel.org/stable/c/79e57889aa0d92a6d769bad808fb105e7b6ea495>
- patch: <https://git.kernel.org/stable/c/9124d51e01232a91da4034768a2a8d1688472179>
- patch: <https://git.kernel.org/stable/c/52ae2b14f76ef2d490337ddc0037bc37125be7b8>
- patch: <https://git.kernel.org/stable/c/4d67c8f74d804b20febf716ec96e9a475457ec60>
- patch: <https://git.kernel.org/stable/c/5d5ddd8771fa9cabeb247fba5f6ab60d63f3fbce>
- patch: <https://git.kernel.org/stable/c/f516fbb63873ee23cba5b7c3d239677c30f13df8>
- patch: <https://git.kernel.org/stable/c/33ec82a6d2b119938f26e5c8040ed5d92378eb54>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50161>

HTML: <https://flawdb.com/CVE-2022-50161> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50161>
