# CVE-2022-50566: mtd: Fix device name leak when register device failed in add\_mtd\_device()

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.32% (percentile 18, 2026-11-26)
- **Published:** 2025-10-22T13:23:23.917Z
- **Modified:** 2026-06-17T05:23:48.233Z

## Who should check

- Anyone running Linux \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< a75f45afa932bfb24a2603ebcea5efd2e7cdcfd6; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 2302e2dc42b1f84f951c725ce742fc21c5a1e151; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< db07fe76df01f40cb897d6e9066b84e46957beb3; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< fa0d32ab8407d7481450c664fd0de64f2dae9489; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 330bc5533e8a8ed69cb951d5a8edce9bddb9db21; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 71212d73184845c944ef1b43f092e643e5bde003; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 1b172fb05d6315ecec082fd7544a3390e96f0d7e; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< bcabe1dc2a344adbb3382930a23e273ba9382277; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 895d68a39481a75c680aa421546931fb11942fa6
- Anyone running Linux 2.6.30

## Description

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

mtd: Fix device name leak when register device failed in add\_mtd\_device()

There is a kmemleak when register device failed:
  unreferenced object 0xffff888101aab550 (size 8):
    comm "insmod", pid 3922, jiffies 4295277753 (age 925.408s)
    hex dump (first 8 bytes):
      6d 74 64 30 00 88 ff ff                          mtd0....
    backtrace:
      \[\<00000000bde26724\>\] \_\_kmalloc\_node\_track\_caller+0x4e/0x150
      \[\<000000003c32b416\>\] kvasprintf+0xb0/0x130
      \[\<000000001f7a8f15\>\] kobject\_set\_name\_vargs+0x2f/0xb0
      \[\<000000006e781163\>\] dev\_set\_name+0xab/0xe0
      \[\<00000000e30d0c78\>\] add\_mtd\_device+0x4bb/0x700
      \[\<00000000f3d34de7\>\] mtd\_device\_parse\_register+0x2ac/0x3f0
      \[\<00000000c0d88488\>\] 0xffffffffa0238457
      \[\<00000000b40d0922\>\] 0xffffffffa02a008f
      \[\<0000000023d17b9d\>\] do\_one\_initcall+0x87/0x2a0
      \[\<00000000770f6ca6\>\] do\_init\_module+0xdf/0x320
      \[\<000000007b6768fe\>\] load\_module+0x2f98/0x3330
      \[\<00000000346bed5a\>\] \_\_do\_sys\_finit\_module+0x113/0x1b0
      \[\<00000000674c2290\>\] do\_syscall\_64+0x35/0x80
      \[\<000000004c6a8d97\>\] entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0

If register device failed, should call put\_device() to give up the
reference.

## Affected and fixed versions

- Linux: \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< a75f45afa932bfb24a2603ebcea5efd2e7cdcfd6; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 2302e2dc42b1f84f951c725ce742fc21c5a1e151; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< db07fe76df01f40cb897d6e9066b84e46957beb3; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< fa0d32ab8407d7481450c664fd0de64f2dae9489; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 330bc5533e8a8ed69cb951d5a8edce9bddb9db21; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 71212d73184845c944ef1b43f092e643e5bde003; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 1b172fb05d6315ecec082fd7544a3390e96f0d7e; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< bcabe1dc2a344adbb3382930a23e273ba9382277; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 895d68a39481a75c680aa421546931fb11942fa6 (cvelist)
- Linux: 2.6.30 (cvelist)

## Mitigation

- Upgrade Linux to 895d68a39481a75c680aa421546931fb11942fa6 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-50566. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50566.md
Affected: Linux >= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, < a75f45afa932bfb24a2603ebcea5efd2e7cdcfd6; >= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, < 2302e2dc42b1f84f951c725ce742fc21c5a1e151; >= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, < db07fe76df01f40cb897d6e9066b84e46957beb3; >= 1f24b5a8ecbb2a3c7080f41…
Fixed in: Linux 2302e2dc42b1f84f951c725ce742fc21c5a1e151, Linux 330bc5533e8a8ed69cb951d5a8edce9bddb9db21, Linux 71212d73184845c944ef1b43f092e643e5bde003, Linux 1b172fb05d6315ecec082fd7544a3390e96f0d7e, Linux 895d68a39481a75c680aa421546931fb11942fa6

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-50566 being exploited?

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< a75f45afa932bfb24a2603ebcea5efd2e7cdcfd6; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 2302e2dc42b1f84f951c725ce742fc21c5a1e151; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< db07fe76df01f40cb897d6e9066b84e46957beb3; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< fa0d32ab8407d7481450c664fd0de64f2dae9489; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 330bc5533e8a8ed69cb951d5a8edce9bddb9db21; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 71212d73184845c944ef1b43f092e643e5bde003; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 1b172fb05d6315ecec082fd7544a3390e96f0d7e; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< bcabe1dc2a344adbb3382930a23e273ba9382277; \>= 1f24b5a8ecbb2a3c7080f418974d40e3ffedb221, \< 895d68a39481a75c680aa421546931fb11942fa6; Linux 2.6.30.

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

Yes. Fixed in Linux 2302e2dc42b1f84f951c725ce742fc21c5a1e151, Linux 330bc5533e8a8ed69cb951d5a8edce9bddb9db21, Linux 71212d73184845c944ef1b43f092e643e5bde003, Linux 1b172fb05d6315ecec082fd7544a3390e96f0d7e, Linux 895d68a39481a75c680aa421546931fb11942fa6. Upgrade Linux to 895d68a39481a75c680aa421546931fb11942fa6 or later.

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

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

- other: <https://git.kernel.org/stable/c/a75f45afa932bfb24a2603ebcea5efd2e7cdcfd6>
- other: <https://git.kernel.org/stable/c/2302e2dc42b1f84f951c725ce742fc21c5a1e151>
- other: <https://git.kernel.org/stable/c/db07fe76df01f40cb897d6e9066b84e46957beb3>
- other: <https://git.kernel.org/stable/c/fa0d32ab8407d7481450c664fd0de64f2dae9489>
- other: <https://git.kernel.org/stable/c/330bc5533e8a8ed69cb951d5a8edce9bddb9db21>
- other: <https://git.kernel.org/stable/c/71212d73184845c944ef1b43f092e643e5bde003>
- other: <https://git.kernel.org/stable/c/1b172fb05d6315ecec082fd7544a3390e96f0d7e>
- other: <https://git.kernel.org/stable/c/bcabe1dc2a344adbb3382930a23e273ba9382277>
- other: <https://git.kernel.org/stable/c/895d68a39481a75c680aa421546931fb11942fa6>

## 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-50566>

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