lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 05 Aug 2021 11:06:57 -0600
From:   Alex Williamson <alex.williamson@...hat.com>
To:     alex.williamson@...hat.com
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Jason Gunthorpe <jgg@...dia.com>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org, jgg@...dia.com,
        peterx@...hat.com
Subject: [PATCH 0/7] vfio: device fd address space and vfio-pci mmap
 invalidation cleanup

vfio-pci currently goes through some pretty nasty locking algorithms
since commit abafbc551fdd ("vfio-pci: Invalidate mmaps and block MMIO
access on disabled memory") was added to invalidate and re-fault mmaps
to device MMIO around cases where device memory is disabled.  This
series greatly simplifies that by making use of an address space on
the vfio device file descriptor, as suggested by Jason Gunthorpe.
This allows us to use unmap_mapping_range() on the device fd to zap
such mappings, and by creating a vma-to-pfn callback, we can implement
a reverse function to restore all mappings.

This series was originally part of a larger series which also added a
callback to get a vfio device from a vma, which allows the IOMMU
backend to limit pfnmaps to vfio device memory.  The long term goal
is to implement the vma-to-pfn for all vfio device drivers to enable
this in the IOMMU backend and proceed with a mechanism to also
invalidate DMA mappings to device memory while disabled.

Given my slow progress towards that longer goal, I'd like to get this
in as an interim cleanup as it seems worthwhile on its own.  I'll
intend to rework this on top of Jason's device_open/close series.
Thanks,

Alex

---

Alex Williamson (7):
      vfio: Create vfio_fs_type with inode per device
      vfio: Export unmap_mapping_range() wrapper
      vfio/pci: Use vfio_device_unmap_mapping_range()
      vfio,vfio-pci: Add vma to pfn callback
      mm/interval_tree.c: Export vma interval tree iterators
      vfio: Add vfio_device_io_remap_mapping_range()
      vfio/pci: Remove map-on-fault behavior


 drivers/vfio/pci/vfio_pci.c         | 279 +++++++---------------------
 drivers/vfio/pci/vfio_pci_config.c  |   8 +-
 drivers/vfio/pci/vfio_pci_private.h |   5 +-
 drivers/vfio/vfio.c                 |  69 ++++++-
 include/linux/vfio.h                |  10 +
 mm/interval_tree.c                  |   3 +
 6 files changed, 156 insertions(+), 218 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ