aboutsummaryrefslogtreecommitdiff
path: root/drivers/vfio/pci/vfio_pci.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-07-25 17:34:18 +0100
committerMark Brown <broonie@kernel.org>2018-07-25 17:34:18 +0100
commit8c9257333713c1f185693fe0df2df79dfc1fa1c8 (patch)
tree60d7fb9170d3cf462685be490b59bf1c012389d3 /drivers/vfio/pci/vfio_pci.c
parent953cb6f07855d41f79b6faa2f334d11116d54afb (diff)
parentdbcdf42bab53d219caa51bcfe54c8b9066010290 (diff)
Merge tag 'v4.9.115' into linux-linaro-lsk-v4.9lsk-v4.9-18.07
This is the 4.9.115 stable release
Diffstat (limited to 'drivers/vfio/pci/vfio_pci.c')
-rw-r--r--drivers/vfio/pci/vfio_pci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 43559bed7822..7338e43faa17 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -28,6 +28,7 @@
#include <linux/uaccess.h>
#include <linux/vfio.h>
#include <linux/vgaarb.h>
+#include <linux/nospec.h>
#include "vfio_pci_private.h"
@@ -755,6 +756,9 @@ static long vfio_pci_ioctl(void *device_data,
if (info.index >=
VFIO_PCI_NUM_REGIONS + vdev->num_regions)
return -EINVAL;
+ info.index = array_index_nospec(info.index,
+ VFIO_PCI_NUM_REGIONS +
+ vdev->num_regions);
i = info.index - VFIO_PCI_NUM_REGIONS;