{"id":"CVE-2021-47140","aliases":["CVE-2021-47140"],"related":[],"kind":"vulnerability","state":"published","title":"iommu/amd: Clear DMA ops when switching domain","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"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és de sysfs. Esto no funciona para AMD IOMMU en este momento porque dev-&gt;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 &gt; /sys/sys/bus/pci/drivers/e1000e/unbind # echo Identity &gt; /sys/ bus/pci/devices/0000:00:05.0/iommu_group/type # echo 0000:00:05.0 &gt; /sys/sys/bus/pci/drivers/e1000e/bind ... ERROR: desreferencia del puntero NULL del kernel, dirección: 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í como lo hace Vt-d.","source":"nvd"}],"published":"2024-03-25T09:07:38.949Z","modified":"2026-06-17T04:16:38.103Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0","fixed":"f3f2cf46291a693eab21adb94171b0128c2a9ec1","status":"affected"},{"type":"git","introduced":"08a27c1c3ecf5e1da193ce5f8fc97c3be16e75f0","fixed":"d6177a6556f853785867e2ec6d5b7f4906f0d809","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.11","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.11","status":"unaffected"},{"type":"semver","introduced":"5.12.9","lastAffected":"5.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.11","fixed":"5.12.9"},{"status":"affected","version":"5.13"},{"status":"affected","version":"5.13"},{"status":"affected","version":"5.13"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/f3f2cf46291a693eab21adb94171b0128c2a9ec1","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d6177a6556f853785867e2ec6d5b7f4906f0d809","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-03-28T18:23:40.850Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-47140","url":"https://www.cve.org/CVERecord?id=CVE-2021-47140","licence":"CVE Terms of Use","modified":"2026-05-11T13:48:49.516Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-47140","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-47140","licence":"Public domain","modified":"2026-06-17T04:16:38.103Z"}],"updatedAt":"2026-11-25T22:58:08.683Z","epss":{"score":0.00603,"percentile":0.50241,"date":"2026-12-01T12:00:22.000Z"}}