{"id":"CVE-2022-50058","summary":"vdpa_sim_blk: set number of address spaces and virtqueue groups","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nvdpa_sim_blk: set number of address spaces and virtqueue groups\n\nCommit bda324fd037a (\"vdpasim: control virtqueue support\") added two\nnew fields (nas, ngroups) to vdpasim_dev_attr, but we forgot to\ninitialize them for vdpa_sim_blk.\n\nWhen creating a new vdpa_sim_blk device this causes the kernel\nto panic in this way:\n    $ vdpa dev add mgmtdev vdpasim_blk name blk0\n    BUG: kernel NULL pointer dereference, address: 0000000000000030\n    ...\n    RIP: 0010:vhost_iotlb_add_range_ctx+0x41/0x220 [vhost_iotlb]\n    ...\n    Call Trace:\n     \u003cTASK\u003e\n     vhost_iotlb_add_range+0x11/0x800 [vhost_iotlb]\n     vdpasim_map_range+0x91/0xd0 [vdpa_sim]\n     vdpasim_alloc_coherent+0x56/0x90 [vdpa_sim]\n     ...\n\nThis happens because vdpasim-\u003eiommu[0] is not initialized when\ndev_attr.nas is 0.\n\nLet's fix this issue by initializing both (nas, ngroups) to 1 for\nvdpa_sim_blk.","modified":"2026-04-11T12:44:51.027287Z","published":"2025-06-18T11:02:06.988Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50058.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50058.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-50058"},{"type":"PACKAGE","url":"https://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/osv-test-cve-osv-conversion/osv-output/CVE-2022-50058.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.19.0"},{"fixed":"5.19.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-50058.json"}}],"schema_version":"1.7.5"}