# CVE-2022-50873: vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove

> A local attacker can trigger a kernel crash by exploiting a wrong pointer free in the vp_vdpa driver, causing a denial of service.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Dec 2025
- **Updated:** 11 May 2026
- **Also known as:** DEBIAN-CVE-2022-50873, GHSA-39pj-4mfg-vcvw, UBUNTU-CVE-2022-50873

## What is CVE-2022-50873?

CVE-2022-50873 is a vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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

vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove

In vp_vdpa_remove(), the code kfree(&vp_vdpa_mgtdev->mgtdev.id_table) uses
a reference of pointer as the argument of kfree, which is the wrong pointer
and then may hit crash like this:

Unable to handle kernel paging request at virtual address 00ffff003363e30c
Internal error: Oops: 96000004 [#1] SMP
Call trace:
 rb_next+0x20/0x5c
 ext4_readdir+0x494/0x5c4 [ext4]
 iterate_dir+0x168/0x1b4
 __se_sys_getdents64+0x68/0x170
 __arm64_sys_getdents64+0x24/0x30
 el0_svc_common.constprop.0+0x7c/0x1bc
 do_el0_svc+0x2c/0x94
 el0_svc+0x20/0x30
 el0_sync_handler+0xb0/0xb4
 el0_sync+0x160/0x180
Code: 54000220 f9400441 b4000161 aa0103e0 (f9400821)
SMP: stopping secondary CPUs
Starting crashdump kernel...

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


## How do I fix CVE-2022-50873?

Apply the vendor's patch.

## Is CVE-2022-50873 being exploited?

There is no known exploitation of CVE-2022-50873 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-50873 and fix it if it is affected.

What it is: CVE-2022-50873 is a vulnerability in Linux, published on 30 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-50873 in the wild and no public exploit code.

Affected product: Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-50873/ (Markdown: https://insights.sbomify.com/CVE-2022-50873/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-50873
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-50873
- OSV: https://osv.dev/vulnerability/CVE-2022-50873

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-50873/
Summaries are generated and may contain mistakes; the official description above is the record.
