cve-2021-47140
Vulnerability from cvelistv5
Published
2024-03-25 09:07
Modified
2024-12-19 07:35
Summary
In the Linux kernel, the following vulnerability has been resolved: iommu/amd: Clear DMA ops when switching domain Since commit 08a27c1c3ecf ("iommu: Add support to change default domain of an iommu group") a user can switch a device between IOMMU and direct DMA through sysfs. This doesn't work for AMD IOMMU at the moment because dev->dma_ops is not cleared when switching from a DMA to an identity IOMMU domain. The DMA layer thus attempts to use the dma-iommu ops on an identity domain, causing an oops: # echo 0000:00:05.0 > /sys/sys/bus/pci/drivers/e1000e/unbind # echo identity > /sys/bus/pci/devices/0000:00:05.0/iommu_group/type # echo 0000:00:05.0 > /sys/sys/bus/pci/drivers/e1000e/bind ... BUG: kernel NULL pointer dereference, address: 0000000000000028 ... Call Trace: iommu_dma_alloc e1000e_setup_tx_resources e1000e_open Since iommu_change_dev_def_domain() calls probe_finalize() again, clear the dma_ops there like Vt-d does.
Impacted products
Vendor Product Version
Linux Linux Version: 08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0
Version: 08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0
Create a notification for this product.
   Linux Linux Version: 5.11
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "cvssV3_1": {
              "attackComplexity": "LOW",
              "attackVector": "NETWORK",
              "availabilityImpact": "LOW",
              "baseScore": 5.3,
              "baseSeverity": "MEDIUM",
              "confidentialityImpact": "NONE",
              "integrityImpact": "NONE",
              "privilegesRequired": "NONE",
              "scope": "UNCHANGED",
              "userInteraction": "NONE",
              "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
              "version": "3.1"
            }
          },
          {
            "other": {
              "content": {
                "id": "CVE-2021-47140",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-03-28T18:23:40.850053Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "problemTypes": [
          {
            "descriptions": [
              {
                "description": "CWE-noinfo Not enough information",
                "lang": "en",
                "type": "CWE"
              }
            ]
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-11-07T16:55:13.305Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:24:39.961Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/iommu/amd/iommu.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "f3f2cf46291a693eab21adb94171b0128c2a9ec1",
              "status": "affected",
              "version": "08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0",
              "versionType": "git"
            },
            {
              "lessThan": "d6177a6556f853785867e2ec6d5b7f4906f0d809",
              "status": "affected",
              "version": "08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/iommu/amd/iommu.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.11"
            },
            {
              "lessThan": "5.11",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.12.*",
              "status": "unaffected",
              "version": "5.12.9",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\niommu/amd: Clear DMA ops when switching domain\n\nSince commit 08a27c1c3ecf (\"iommu: Add support to change default domain\nof an iommu group\") a user can switch a device between IOMMU and direct\nDMA through sysfs. This doesn\u0027t work for AMD IOMMU at the moment because\ndev-\u003edma_ops is not cleared when switching from a DMA to an identity\nIOMMU domain. The DMA layer thus attempts to use the dma-iommu ops on an\nidentity domain, causing an oops:\n\n  # echo 0000:00:05.0 \u003e /sys/sys/bus/pci/drivers/e1000e/unbind\n  # echo identity \u003e /sys/bus/pci/devices/0000:00:05.0/iommu_group/type\n  # echo 0000:00:05.0 \u003e /sys/sys/bus/pci/drivers/e1000e/bind\n   ...\n  BUG: kernel NULL pointer dereference, address: 0000000000000028\n   ...\n   Call Trace:\n    iommu_dma_alloc\n    e1000e_setup_tx_resources\n    e1000e_open\n\nSince iommu_change_dev_def_domain() calls probe_finalize() again, clear\nthe dma_ops there like Vt-d does."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2024-12-19T07:35:59.477Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1"
        },
        {
          "url": "https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809"
        }
      ],
      "title": "iommu/amd: Clear DMA ops when switching domain",
      "x_generator": {
        "engine": "bippy-5f407fcff5a0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47140",
    "datePublished": "2024-03-25T09:07:38.949Z",
    "dateReserved": "2024-03-04T18:12:48.842Z",
    "dateUpdated": "2024-12-19T07:35:59.477Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2021-47140\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2024-03-25T09:15:08.740\",\"lastModified\":\"2024-11-21T06:35:28.713\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\niommu/amd: Clear DMA ops when switching domain\\n\\nSince commit 08a27c1c3ecf (\\\"iommu: Add support to change default domain\\nof an iommu group\\\") a user can switch a device between IOMMU and direct\\nDMA through sysfs. This doesn\u0027t work for AMD IOMMU at the moment because\\ndev-\u003edma_ops is not cleared when switching from a DMA to an identity\\nIOMMU domain. The DMA layer thus attempts to use the dma-iommu ops on an\\nidentity domain, causing an oops:\\n\\n  # echo 0000:00:05.0 \u003e /sys/sys/bus/pci/drivers/e1000e/unbind\\n  # echo identity \u003e /sys/bus/pci/devices/0000:00:05.0/iommu_group/type\\n  # echo 0000:00:05.0 \u003e /sys/sys/bus/pci/drivers/e1000e/bind\\n   ...\\n  BUG: kernel NULL pointer dereference, address: 0000000000000028\\n   ...\\n   Call Trace:\\n    iommu_dma_alloc\\n    e1000e_setup_tx_resources\\n    e1000e_open\\n\\nSince iommu_change_dev_def_domain() calls probe_finalize() again, clear\\nthe dma_ops there like Vt-d does.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: iommu/amd: borra las operaciones de DMA al cambiar de dominio. Desde el commit 08a27c1c3ecf (\\\"iommu: agrega soporte para cambiar el dominio predeterminado de un grupo iommu\\\"), un usuario puede cambiar un dispositivo entre IOMMU y DMA directo a trav\u00e9s de sysfs. Esto no funciona para AMD IOMMU en este momento porque dev-\u0026gt;dma_ops no se borra al cambiar de un DMA a un dominio IOMMU de identidad. Por lo tanto, la capa DMA intenta utilizar las operaciones dma-iommu en un dominio de identidad, lo que provoca un error: # echo 0000:00:05.0 \u0026gt; /sys/sys/bus/pci/drivers/e1000e/unbind # echo Identity \u0026gt; /sys/ bus/pci/devices/0000:00:05.0/iommu_group/type # echo 0000:00:05.0 \u0026gt; /sys/sys/bus/pci/drivers/e1000e/bind ... ERROR: desreferencia del puntero NULL del kernel, direcci\u00f3n: 0000000000000028 ... Seguimiento de llamadas: iommu_dma_alloc e1000e_setup_tx_resources e1000e_open Dado que iommu_change_dev_def_domain() llama a probe_finalize() nuevamente, borre dma_ops all\u00ed como lo hace Vt-d.\"}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"134c704f-9b21-4f2e-91b3-4a467353bcc0\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L\",\"baseScore\":5.3,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"NETWORK\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"NONE\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"LOW\"},\"exploitabilityScore\":3.9,\"impactScore\":1.4}]},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"},{\"url\":\"https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1\",\"source\":\"af854a3a-2127-422b-91ae-364da2661108\"}]}}",
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:24:39.961Z\"}}, {\"title\": \"CISA ADP Vulnrichment\", \"metrics\": [{\"cvssV3_1\": {\"scope\": \"UNCHANGED\", \"version\": \"3.1\", \"baseScore\": 5.3, \"attackVector\": \"NETWORK\", \"baseSeverity\": \"MEDIUM\", \"vectorString\": \"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L\", \"integrityImpact\": \"NONE\", \"userInteraction\": \"NONE\", \"attackComplexity\": \"LOW\", \"availabilityImpact\": \"LOW\", \"privilegesRequired\": \"NONE\", \"confidentialityImpact\": \"NONE\"}}, {\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47140\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-03-28T18:23:40.850053Z\"}}}], \"problemTypes\": [{\"descriptions\": [{\"lang\": \"en\", \"type\": \"CWE\", \"description\": \"CWE-noinfo Not enough information\"}]}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-23T19:01:19.869Z\"}}], \"cna\": {\"title\": \"iommu/amd: Clear DMA ops when switching domain\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0\", \"lessThan\": \"f3f2cf46291a693eab21adb94171b0128c2a9ec1\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0\", \"lessThan\": \"d6177a6556f853785867e2ec6d5b7f4906f0d809\", \"versionType\": \"git\"}], \"programFiles\": [\"drivers/iommu/amd/iommu.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.11\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.11\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.12.9\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.12.*\"}, {\"status\": \"unaffected\", \"version\": \"5.13\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"drivers/iommu/amd/iommu.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1\"}, {\"url\": \"https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809\"}], \"x_generator\": {\"engine\": \"bippy-5f407fcff5a0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\niommu/amd: Clear DMA ops when switching domain\\n\\nSince commit 08a27c1c3ecf (\\\"iommu: Add support to change default domain\\nof an iommu group\\\") a user can switch a device between IOMMU and direct\\nDMA through sysfs. This doesn\u0027t work for AMD IOMMU at the moment because\\ndev-\u003edma_ops is not cleared when switching from a DMA to an identity\\nIOMMU domain. The DMA layer thus attempts to use the dma-iommu ops on an\\nidentity domain, causing an oops:\\n\\n  # echo 0000:00:05.0 \u003e /sys/sys/bus/pci/drivers/e1000e/unbind\\n  # echo identity \u003e /sys/bus/pci/devices/0000:00:05.0/iommu_group/type\\n  # echo 0000:00:05.0 \u003e /sys/sys/bus/pci/drivers/e1000e/bind\\n   ...\\n  BUG: kernel NULL pointer dereference, address: 0000000000000028\\n   ...\\n   Call Trace:\\n    iommu_dma_alloc\\n    e1000e_setup_tx_resources\\n    e1000e_open\\n\\nSince iommu_change_dev_def_domain() calls probe_finalize() again, clear\\nthe dma_ops there like Vt-d does.\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-12-19T07:35:59.477Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2021-47140\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-12-19T07:35:59.477Z\", \"dateReserved\": \"2024-03-04T18:12:48.842Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-03-25T09:07:38.949Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


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.