{"id":"CVE-2022-50058","state":"PUBLISHED","title":"vdpa_sim_blk: set number of address spaces and virtqueue groups","description":"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     <TASK>\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->iommu[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.","publishedAt":"2025-06-18T11:02:06.988Z","updatedAt":"2026-05-11T19:12:02.846Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bda324fd037a6b0d44da5699574ce741ca161bc4","status":"affected","lessThan":"a291c7d289fac2cb13fb2614a9a251afbbd86ce9","versionType":"git"},{"version":"bda324fd037a6b0d44da5699574ce741ca161bc4","status":"affected","lessThan":"19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vdpa/vdpa_sim/vdpa_sim_blk.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.4","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vdpa/vdpa_sim/vdpa_sim_blk.c"]}],"references":["https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9","https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50058.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50058","state":"PUBLISHED","datePublished":"2025-06-18T11:02:06.988Z","dateUpdated":"2026-05-11T19:12:02.846Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-06-18T10:57:27.404Z"},"containers":{"cna":{"title":"vdpa_sim_blk: set number of address spaces and virtqueue groups","descriptions":[{"lang":"en","value":"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     <TASK>\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->iommu[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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"bda324fd037a6b0d44da5699574ce741ca161bc4","status":"affected","lessThan":"a291c7d289fac2cb13fb2614a9a251afbbd86ce9","versionType":"git"},{"version":"bda324fd037a6b0d44da5699574ce741ca161bc4","status":"affected","lessThan":"19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vdpa/vdpa_sim/vdpa_sim_blk.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"5.19.4","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/vdpa/vdpa_sim/vdpa_sim_blk.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9"},{"url":"https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T19:12:02.846Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"5.19.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}