linux-stable/drivers/vfio
Jason Gunthorpe 5d8ddc819c vfio: Use get_user_pages_longterm correctly
commit bb94b55af3 upstream.

The patch noted in the fixes below converted get_user_pages_fast() to
get_user_pages_longterm(), however the two calls differ in a few ways.

First _fast() is documented to not require the mmap_sem, while _longterm()
is documented to need it. Hold the mmap sem as required.

Second, _fast accepts an 'int write' while _longterm uses 'unsigned int
gup_flags', so the expression '!!(prot & IOMMU_WRITE)' is only working by
luck as FOLL_WRITE is currently == 0x1. Use the expected FOLL_WRITE
constant instead.

Fixes: 94db151dc8 ("vfio: disable filesystem-dax page pinning")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-11 16:29:15 +02:00
..
mdev vfio/mdev: Use a module softdep for vfio_mdev 2017-02-08 13:13:25 -07:00
pci vfio/pci: Virtualize Maximum Read Request Size 2018-04-24 09:36:34 +02:00
platform License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig vfio: Fix build break when SPAPR_TCE_IOMMU=n 2017-02-08 13:13:25 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio.c vfio: Stall vfio_del_group_dev() for container group detach 2017-08-30 14:02:16 -06:00
vfio_iommu_spapr_tce.c powerpc updates for 4.12 part 1. 2017-05-05 11:36:44 -07:00
vfio_iommu_type1.c vfio: Use get_user_pages_longterm correctly 2018-07-11 16:29:15 +02:00
vfio_spapr_eeh.c drivers/vfio: Support EEH error injection 2015-05-12 20:33:35 +10:00
virqfd.c sched/wait: Rename wait_queue_t => wait_queue_entry_t 2017-06-20 12:18:27 +02:00