# CVE-2022-50738: vhost-vdpa: fix an iotlb memory leak

> 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.27% (percentile 13, 2026-11-28)
- **Published:** 2025-12-24T13:05:36.801Z
- **Modified:** 2026-11-10T12:10:00.177Z

## Who should check

- Anyone running Linux \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< 4e92cb33bfb51eee5f28bb10846c46f266a4bb67; \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< a2907867e2c86067accd2f011d6f23ee5533aa6c; \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< c070c1912a83432530cbb4271d5b9b11fa36b67a
- Anyone running Linux 5.19

## Description

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

vhost-vdpa: fix an iotlb memory leak

Before commit 3d5698793897 ("vhost-vdpa: introduce asid based IOTLB")
we called vhost\_vdpa\_iotlb\_unmap(v, iotlb, 0ULL, 0ULL - 1) during
release to free all the resources allocated when processing user IOTLB
messages through vhost\_vdpa\_process\_iotlb\_update().
That commit changed the handling of IOTLB a bit, and we accidentally
removed some code called during the release.

We partially fixed this with commit 037d4305569a ("vhost-vdpa: call
vhost\_vdpa\_cleanup during the release") but a potential memory leak is
still there as showed by kmemleak if the application does not send
VHOST\_IOTLB\_INVALIDATE or crashes:

  unreferenced object 0xffff888007fbaa30 (size 16):
    comm "blkio-bench", pid 914, jiffies 4294993521 (age 885.500s)
    hex dump (first 16 bytes):
      40 73 41 07 80 88 ff ff 00 00 00 00 00 00 00 00  @sA.............
    backtrace:
      \[\<0000000087736d2a\>\] kmem\_cache\_alloc\_trace+0x142/0x1c0
      \[\<0000000060740f50\>\] vhost\_vdpa\_process\_iotlb\_msg+0x68c/0x901 \[vhost\_vdpa\]
      \[\<0000000083e8e205\>\] vhost\_chr\_write\_iter+0xc0/0x4a0 \[vhost\]
      \[\<000000008f2f414a\>\] vhost\_vdpa\_chr\_write\_iter+0x18/0x20 \[vhost\_vdpa\]
      \[\<00000000de1cd4a0\>\] vfs\_write+0x216/0x4b0
      \[\<00000000a2850200\>\] ksys\_write+0x71/0xf0
      \[\<00000000de8e720b\>\] \_\_x64\_sys\_write+0x19/0x20
      \[\<0000000018b12cbb\>\] do\_syscall\_64+0x3f/0x90
      \[\<00000000986ec465\>\] entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

Let's fix this calling vhost\_vdpa\_iotlb\_unmap() on the whole range in
vhost\_vdpa\_remove\_as(). We move that call before vhost\_dev\_cleanup()
since we need a valid v-\>vdev.mm in vhost\_vdpa\_pa\_unmap().
vhost\_iotlb\_reset() call can be removed, since vhost\_vdpa\_iotlb\_unmap()
on the whole range removes all the entries.

The kmemleak log reported was observed with a vDPA device that has \`use\_va\`
set to true (e.g. VDUSE). This patch has been tested with both types of
devices.

## Affected and fixed versions

- Linux: \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< 4e92cb33bfb51eee5f28bb10846c46f266a4bb67; \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< a2907867e2c86067accd2f011d6f23ee5533aa6c; \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< c070c1912a83432530cbb4271d5b9b11fa36b67a (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-50738.md
Affected: Linux >= 3d5698793897a2b9c0060d899881d1a0591630d5, < 4e92cb33bfb51eee5f28bb10846c46f266a4bb67; >= 3d5698793897a2b9c0060d899881d1a0591630d5, < a2907867e2c86067accd2f011d6f23ee5533aa6c; >= 3d5698793897a2b9c0060d899881d1a0591630d5, < c070c1912a83432530cbb4271d5b9b11fa36b67a; Linux 5.19
Fixed in: Linux 4e92cb33bfb51eee5f28bb10846c46f266a4bb67

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

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< 4e92cb33bfb51eee5f28bb10846c46f266a4bb67; \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< a2907867e2c86067accd2f011d6f23ee5533aa6c; \>= 3d5698793897a2b9c0060d899881d1a0591630d5, \< c070c1912a83432530cbb4271d5b9b11fa36b67a; Linux 5.19.

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

Yes. Fixed in Linux 4e92cb33bfb51eee5f28bb10846c46f266a4bb67. No fix listed yet: follow the vendor advisory.

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

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/4e92cb33bfb51eee5f28bb10846c46f266a4bb67>
- other: <https://git.kernel.org/stable/c/a2907867e2c86067accd2f011d6f23ee5533aa6c>
- other: <https://git.kernel.org/stable/c/c070c1912a83432530cbb4271d5b9b11fa36b67a>

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

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