# CVE-2022-50058: vdpa_sim_blk: set number of address spaces and virtqueue groups

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-01)
- Published: 2025-06-18T11:02:06.988Z
- Modified: 2026-06-17T05:22:39.683Z
- Weaknesses: CWE-476
- Assigned by: Linux

## Description

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

vdpa_sim_blk: set number of address spaces and virtqueue groups

Commit bda324fd037a ("vdpasim: control virtqueue support") added two
new fields (nas, ngroups) to vdpasim_dev_attr, but we forgot to
initialize them for vdpa_sim_blk.

When creating a new vdpa_sim_blk device this causes the kernel
to panic in this way:
    $ vdpa dev add mgmtdev vdpasim_blk name blk0
    BUG: kernel NULL pointer dereference, address: 0000000000000030
    ...
    RIP: 0010:vhost_iotlb_add_range_ctx+0x41/0x220 [vhost_iotlb]
    ...
    Call Trace:
     <TASK>
     vhost_iotlb_add_range+0x11/0x800 [vhost_iotlb]
     vdpasim_map_range+0x91/0xd0 [vdpa_sim]
     vdpasim_alloc_coherent+0x56/0x90 [vdpa_sim]
     ...

This happens because vdpasim->iommu[0] is not initialized when
dev_attr.nas is 0.

Let's fix this issue by initializing both (nas, ngroups) to 1 for
vdpa_sim_blk.

(As written by CVE List.)

## Affected

- Linux Linux: from bda324fd037a6b0d44da5699574ce741ca161bc4 before a291c7d289fac2cb13fb2614a9a251afbbd86ce9; from bda324fd037a6b0d44da5699574ce741ca161bc4 before 19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809; 5.19 (not affected: before 5.19; from 5.19.4 up to 5.19.*; from 6.0 up to *)
- linux linux_kernel: from 5.19 before 5.19.4

## References

- <https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9> (patch)
- <https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809> (patch)

## Sources

- CVE List: [CVE-2022-50058](https://www.cve.org/CVERecord?id=CVE-2022-50058), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-50058](https://nvd.nist.gov/vuln/detail/CVE-2022-50058), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-50058 · Whole record: https://cve.day/CVE-2022-50058.json · Rebuilt by cve.day 2026-11-25T22:58:21.032Z
