{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-47140","id":"CVE-2021-47140","title":"iommu/amd: Clear DMA ops when switching domain","description":"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't work for AMD IOMMU at the moment because\ndev->dma_ops is not cleared when switching from a DMA to an identi","descriptionLong":"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't work for AMD IOMMU at the moment because\ndev->dma_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 > /sys/sys/bus/pci/drivers/e1000e/unbind\n  # echo identity > /sys/bus/pci/devices/0000:00:05.0/iommu_group/type\n  # echo 0000:00:05.0 > /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.","published":"2024-03-25T09:07:38.949Z","updated":"2026-06-17T04:16:38.103Z","reserved":"2024-03-04T18:12:48.842Z","status":"Analyzed","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"CISA-ADP"},"metrics":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"CISA-ADP"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","rating":"medium","source":"OSV"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0","lessThan":"f3f2cf46291a693eab21adb94171b0128c2a9ec1","status":"affected","versionType":"git"},{"version":"08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0","lessThan":"d6177a6556f853785867e2ec6d5b7f4906f0d809","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","lessThan":"5.11","status":"unaffected","versionType":"semver"},{"version":"5.12.9","lessThanOrEqual":"5.12.*","status":"unaffected","versionType":"semver"},{"version":"5.13","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-476"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809","tags":["x_transferred","Patch","fix"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00603,"epssPercentile":0.49681,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-47140","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-47140","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-47140","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-47140","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}