linux-stable/drivers/vfio
Zhenyu Wang 8704e89349 vfio/pci: Fix OpRegion read
This is to fix incorrect pointer arithmetic which caused wrong
OpRegion version returned, then VM driver got error to get wanted
VBT block. We need to be safe to return correct data, so force
pointer type for byte access.

Fixes: 49ba1a2976 ("vfio/pci: Add OpRegion 2.0+ Extended VBT support.")
Cc: Colin Xu <colin.xu@gmail.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Dmitry Torokhov <dtor@chromium.org>
Cc: "Xu, Terrence" <terrence.xu@intel.com>
Cc: "Gao, Fred" <fred.gao@intel.com>
Acked-by: Colin Xu <colin.xu@gmail.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Link: https://lore.kernel.org/r/20211125051328.3359902-1-zhenyuw@linux.intel.com
[aw: line wrap]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2021-11-30 11:41:49 -07:00
..
fsl-mc Merge branch 'v5.16/vfio/diana-fsl-reset-v2' into v5.16/vfio/next 2021-10-11 15:50:49 -06:00
mdev vfio: simplify iommu group allocation for mediated devices 2021-09-30 12:46:44 -06:00
pci vfio/pci: Fix OpRegion read 2021-11-30 11:41:49 -07:00
platform vfio: Move vfio_iommu_group_get() to vfio_register_group_dev() 2021-09-30 12:46:43 -06:00
Kconfig vfio: Use kconfig if XX/endif blocks instead of repeating 'depends on' 2021-08-26 10:36:51 -06:00
Makefile vfio/fsl-mc: Add VFIO framework skeleton for fsl-mc devices 2020-10-07 14:17:33 -06:00
vfio.c vfio: remove all kernel-doc notation 2021-11-30 11:41:43 -07:00
vfio.h vfio: clean up the check for mediated device in vfio_iommu_type1 2021-09-30 12:46:44 -06:00
vfio_iommu_spapr_tce.c vfio/spapr_tce: reject mediated devices 2021-09-30 12:46:44 -06:00
vfio_iommu_type1.c vfio/iommu_type1: remove IS_IOMMU_CAP_DOMAIN_IN_CONTAINER 2021-09-30 12:46:45 -06:00
vfio_spapr_eeh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
virqfd.c vfio/virqfd: Drain events from eventfd in virqfd_wakeup() 2020-11-15 09:49:10 -05:00