Skip to content

vfio: Fix for CVE-2020-12888

Ajay Kaher kvm lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3vfio/type1: Support faulting PFNMAP vmasdrivers/vfio/vfio_iommu_type1.c+33 -30 replies
2/3vfio-pci: Fault mmaps to enable vma trackingdrivers/vfio/pci/vfio_pci.c drivers/vfio/pci/vfio_pci_private.h+80 -21 reply
3/3vfio-pci: Invalidate mmaps and block MMIO access on disabled memorydrivers/vfio/pci/vfio_pci.c drivers/vfio/pci/vfio_pci_config.c drivers/vfio/pci/vfio_pci_intrs.c +2 more+334 -480 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchPeter Xu
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH v4.14.y 0/3] vfio: Fix for CVE-2020-12888

CVE-2020-12888 Kernel: vfio: access to disabled MMIO space of some devices may lead to DoS scenario

The VFIO modules allow users (guest VMs) to enable or disable access to the devices' MMIO memory address spaces. If a user attempts to access (read/write) the devices' MMIO address space when it is disabled, some h/w devices issue an interrupt to the CPU to indicate a fatal error condition, crashing the system. This flaw allows a guest user or process to crash the host system resulting in a denial of service.

Patch 1/ is to force the user fault if PFNMAP vma might be DMA mapped before user access.

Patch 2/ setup a vm_ops handler to support dynamic faulting instead of calling remap_pfn_range(). Also provides a list of vmas actively mapping the area which can later use to invalidate those mappings.

Patch 3/ block the user from accessing memory spaces which is disabled by using new vma list support to zap, or invalidate, those memory mappings in order to force them to be faulted back in on access.

Upstreamed patches link:
https://lore.kernel.org/kvm/[email protected]

[PATCH v4.14.y 1/3]:
Backporting of upsream commit 41311242221e:
vfio/type1: Support faulting PFNMAP vmas

[PATCH v4.14.y 2/3]:
Backporting of upsream commit 11c4cd07ba11:
vfio-pci: Fault mmaps to enable vma tracking

[PATCH v4.14.y 3/3]:
Backporting of upsream commit abafbc551fdd:
vfio-pci: Invalidate mmaps and block MMIO access on disabled memory