CVE-2022-50058 (GCVE-0-2022-50058)
Vulnerability from cvelistv5
Published
2025-06-18 11:02
Modified
2025-06-18 11:02
Severity ?
Summary
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.
Impacted products
Vendor Product Version
Linux Linux Version: bda324fd037a6b0d44da5699574ce741ca161bc4
Version: bda324fd037a6b0d44da5699574ce741ca161bc4
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/vdpa/vdpa_sim/vdpa_sim_blk.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "a291c7d289fac2cb13fb2614a9a251afbbd86ce9",
              "status": "affected",
              "version": "bda324fd037a6b0d44da5699574ce741ca161bc4",
              "versionType": "git"
            },
            {
              "lessThan": "19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809",
              "status": "affected",
              "version": "bda324fd037a6b0d44da5699574ce741ca161bc4",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/vdpa/vdpa_sim/vdpa_sim_blk.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.19"
            },
            {
              "lessThan": "5.19",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.0",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.19.4",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0",
                  "versionStartIncluding": "5.19",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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 \u00a0 \u00a0$ vdpa dev add mgmtdev vdpasim_blk name blk0\n \u00a0 \u00a0BUG: kernel NULL pointer dereference, address: 0000000000000030\n \u00a0 \u00a0...\n \u00a0 \u00a0RIP: 0010:vhost_iotlb_add_range_ctx+0x41/0x220 [vhost_iotlb]\n \u00a0 \u00a0...\n \u00a0 \u00a0Call Trace:\n \u00a0 \u00a0 \u003cTASK\u003e\n \u00a0 \u00a0 vhost_iotlb_add_range+0x11/0x800 [vhost_iotlb]\n \u00a0 \u00a0 vdpasim_map_range+0x91/0xd0 [vdpa_sim]\n \u00a0 \u00a0 vdpasim_alloc_coherent+0x56/0x90 [vdpa_sim]\n \u00a0 \u00a0 ...\n\nThis happens because vdpasim-\u003eiommu[0] is not initialized when\ndev_attr.nas is 0.\n\nLet\u0027s fix this issue by initializing both (nas, ngroups) to 1 for\nvdpa_sim_blk."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-06-18T11:02:06.988Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9"
        },
        {
          "url": "https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809"
        }
      ],
      "title": "vdpa_sim_blk: set number of address spaces and virtqueue groups",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50058",
    "datePublished": "2025-06-18T11:02:06.988Z",
    "dateReserved": "2025-06-18T10:57:27.404Z",
    "dateUpdated": "2025-06-18T11:02:06.988Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50058\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-06-18T11:15:34.497\",\"lastModified\":\"2025-06-18T13:47:40.833\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"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 \u00a0 \u00a0$ vdpa dev add mgmtdev vdpasim_blk name blk0\\n \u00a0 \u00a0BUG: kernel NULL pointer dereference, address: 0000000000000030\\n \u00a0 \u00a0...\\n \u00a0 \u00a0RIP: 0010:vhost_iotlb_add_range_ctx+0x41/0x220 [vhost_iotlb]\\n \u00a0 \u00a0...\\n \u00a0 \u00a0Call Trace:\\n \u00a0 \u00a0 \u003cTASK\u003e\\n \u00a0 \u00a0 vhost_iotlb_add_range+0x11/0x800 [vhost_iotlb]\\n \u00a0 \u00a0 vdpasim_map_range+0x91/0xd0 [vdpa_sim]\\n \u00a0 \u00a0 vdpasim_alloc_coherent+0x56/0x90 [vdpa_sim]\\n \u00a0 \u00a0 ...\\n\\nThis happens because vdpasim-\u003eiommu[0] is not initialized when\\ndev_attr.nas is 0.\\n\\nLet\u0027s fix this issue by initializing both (nas, ngroups) to 1 for\\nvdpa_sim_blk.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: vdpa_sim_blk: establecer el n\u00famero de espacios de direcciones y grupos virtqueue. el commit bda324fd037a (\\\"vdpasim: controlar la compatibilidad con virtqueue\\\") agreg\u00f3 dos nuevos campos (nas, ngroups) a vdpasim_dev_attr, pero olvidamos inicializarlos para vdpa_sim_blk. Al crear un nuevo dispositivo vdpa_sim_blk esto hace que el kernel entre en p\u00e1nico de esta manera: $ 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] ... Esto sucede porque vdpasim-\u0026gt;iommu[0] no se inicializa cuando dev_attr.nas es 0. Solucionemos este problema inicializando ambos (nas, ngroups) en 1 para vdpa_sim_blk.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/19cd4a5471b8eaa4bd161b0fdb4567f2fc88d809\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/a291c7d289fac2cb13fb2614a9a251afbbd86ce9\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…