CVE-2022-50058

Source
https://cve.org/CVERecord?id=CVE-2022-50058
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50058.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-50058
Downstream
Published
2025-06-18T11:02:06Z
Modified
2026-08-12T03:51:44Z
Summary
vdpa_sim_blk: set number of address spaces and virtqueue groups
Details

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:         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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50058.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
bda324fd037a6b0d44da5699574ce741ca161bc4
Fixed
a291c7d289fac2cb13fb2614a9a251afbbd86ce9
Fixed
19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50058.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.19.0
Fixed
5.19.4

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50058.json"