Merge tag 'vfio-v4.18-rc6' of git://github.com/awilliam/linux-vfio
Pull VFIO fix from Alex Williamson: "Harden potential Spectre v1 issue (Gustavo A. R. Silva)" * tag 'vfio-v4.18-rc6' of git://github.com/awilliam/linux-vfio: vfio/pci: Fix potential Spectre v1
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <linux/vfio.h>
|
#include <linux/vfio.h>
|
||||||
#include <linux/vgaarb.h>
|
#include <linux/vgaarb.h>
|
||||||
|
#include <linux/nospec.h>
|
||||||
|
|
||||||
#include "vfio_pci_private.h"
|
#include "vfio_pci_private.h"
|
||||||
|
|
||||||
@@ -727,6 +728,9 @@ static long vfio_pci_ioctl(void *device_data,
|
|||||||
if (info.index >=
|
if (info.index >=
|
||||||
VFIO_PCI_NUM_REGIONS + vdev->num_regions)
|
VFIO_PCI_NUM_REGIONS + vdev->num_regions)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
info.index = array_index_nospec(info.index,
|
||||||
|
VFIO_PCI_NUM_REGIONS +
|
||||||
|
vdev->num_regions);
|
||||||
|
|
||||||
i = info.index - VFIO_PCI_NUM_REGIONS;
|
i = info.index - VFIO_PCI_NUM_REGIONS;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user