CVE-2022-50117 (GCVE-0-2022-50117)
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: vfio: Split migration ops from main device ops vfio core checks whether the driver sets some migration op (e.g. set_state/get_state) and accordingly calls its op. However, currently mlx5 driver sets the above ops without regards to its migration caps. This might lead to unexpected usage/Oops if user space may call to the above ops even if the driver doesn't support migration. As for example, the migration state_mutex is not initialized in that case. The cleanest way to manage that seems to split the migration ops from the main device ops, this will let the driver setting them separately from the main ops when it's applicable. As part of that, validate ops construction on registration and include a check for VFIO_MIGRATION_STOP_COPY since the uAPI claims it must be set in migration_flags. HISI driver was changed as well to match this scheme. This scheme may enable down the road to come with some extra group of ops (e.g. DMA log) that can be set without regards to the other options based on driver caps.
Impacted products
Vendor Product Version
Linux Linux Version: 6fadb021266d03c5fd7bca2cfa1607efd246dad1
Version: 6fadb021266d03c5fd7bca2cfa1607efd246dad1
Create a notification for this product.
   Linux Linux Version: 5.18
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c",
            "drivers/vfio/pci/mlx5/cmd.c",
            "drivers/vfio/pci/mlx5/cmd.h",
            "drivers/vfio/pci/mlx5/main.c",
            "drivers/vfio/pci/vfio_pci_core.c",
            "drivers/vfio/vfio.c",
            "include/linux/vfio.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "bba6b12d73d36e0ddbc2c3ac5668a667b00d4345",
              "status": "affected",
              "version": "6fadb021266d03c5fd7bca2cfa1607efd246dad1",
              "versionType": "git"
            },
            {
              "lessThan": "6e97eba8ad8748fabb795cffc5d9e1a7dcfd7367",
              "status": "affected",
              "version": "6fadb021266d03c5fd7bca2cfa1607efd246dad1",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c",
            "drivers/vfio/pci/mlx5/cmd.c",
            "drivers/vfio/pci/mlx5/cmd.h",
            "drivers/vfio/pci/mlx5/main.c",
            "drivers/vfio/pci/vfio_pci_core.c",
            "drivers/vfio/vfio.c",
            "include/linux/vfio.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.18"
            },
            {
              "lessThan": "5.18",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.19.*",
              "status": "unaffected",
              "version": "5.19.2",
              "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.2",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.0",
                  "versionStartIncluding": "5.18",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nvfio: Split migration ops from main device ops\n\nvfio core checks whether the driver sets some migration op (e.g.\nset_state/get_state) and accordingly calls its op.\n\nHowever, currently mlx5 driver sets the above ops without regards to its\nmigration caps.\n\nThis might lead to unexpected usage/Oops if user space may call to the\nabove ops even if the driver doesn\u0027t support migration. As for example,\nthe migration state_mutex is not initialized in that case.\n\nThe cleanest way to manage that seems to split the migration ops from\nthe main device ops, this will let the driver setting them separately\nfrom the main ops when it\u0027s applicable.\n\nAs part of that, validate ops construction on registration and include a\ncheck for VFIO_MIGRATION_STOP_COPY since the uAPI claims it must be set\nin migration_flags.\n\nHISI driver was changed as well to match this scheme.\n\nThis scheme may enable down the road to come with some extra group of\nops (e.g. DMA log) that can be set without regards to the other options\nbased on driver caps."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-06-18T11:02:47.994Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/bba6b12d73d36e0ddbc2c3ac5668a667b00d4345"
        },
        {
          "url": "https://git.kernel.org/stable/c/6e97eba8ad8748fabb795cffc5d9e1a7dcfd7367"
        }
      ],
      "title": "vfio: Split migration ops from main device ops",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2022-50117",
    "datePublished": "2025-06-18T11:02:47.994Z",
    "dateReserved": "2025-06-18T10:57:27.415Z",
    "dateUpdated": "2025-06-18T11:02:47.994Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2022-50117\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-06-18T11:15:41.370\",\"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\\nvfio: Split migration ops from main device ops\\n\\nvfio core checks whether the driver sets some migration op (e.g.\\nset_state/get_state) and accordingly calls its op.\\n\\nHowever, currently mlx5 driver sets the above ops without regards to its\\nmigration caps.\\n\\nThis might lead to unexpected usage/Oops if user space may call to the\\nabove ops even if the driver doesn\u0027t support migration. As for example,\\nthe migration state_mutex is not initialized in that case.\\n\\nThe cleanest way to manage that seems to split the migration ops from\\nthe main device ops, this will let the driver setting them separately\\nfrom the main ops when it\u0027s applicable.\\n\\nAs part of that, validate ops construction on registration and include a\\ncheck for VFIO_MIGRATION_STOP_COPY since the uAPI claims it must be set\\nin migration_flags.\\n\\nHISI driver was changed as well to match this scheme.\\n\\nThis scheme may enable down the road to come with some extra group of\\nops (e.g. DMA log) that can be set without regards to the other options\\nbased on driver caps.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/6e97eba8ad8748fabb795cffc5d9e1a7dcfd7367\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/bba6b12d73d36e0ddbc2c3ac5668a667b00d4345\",\"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…