1
0
Fork 0
remarkable-linux/drivers/vfio/pci
Gustavo A. R. Silva a5b8eae536 vfio/pci: Fix potential Spectre v1
commit 0e714d2778 upstream.

info.index can be indirectly controlled by user-space, hence leading
to a potential exploitation of the Spectre variant 1 vulnerability.

This issue was detected with the help of Smatch:

drivers/vfio/pci/vfio_pci.c:734 vfio_pci_ioctl()
warn: potential spectre issue 'vdev->region'

Fix this by sanitizing info.index before indirectly using it to index
vdev->region

Notice that given that speculation windows are large, the policy is
to kill the speculation on the first load and not worry if it can be
completed with a dependent load/store [1].

[1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2

Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-25 11:25:08 +02:00
..
Kconfig vfio/pci: Intel IGD OpRegion support 2016-02-22 16:10:09 -07:00
Makefile vfio/pci: Intel IGD OpRegion support 2016-02-22 16:10:09 -07:00
vfio_pci.c vfio/pci: Fix potential Spectre v1 2018-07-25 11:25:08 +02:00
vfio_pci_config.c vfio/pci: Virtualize Maximum Read Request Size 2018-04-24 09:36:34 +02:00
vfio_pci_igd.c vfio/pci: Intel IGD host and LCP bridge config space access 2016-02-22 16:10:09 -07:00
vfio_pci_intrs.c vfio/pci: Fix integer overflows, bitmask check 2016-10-26 13:49:29 -06:00
vfio_pci_private.h vfio_pci: use pci_alloc_irq_vectors 2016-09-29 13:36:38 -06:00
vfio_pci_rdwr.c vfio-pci: use 32-bit comparisons for register address for gcc-4.5 2016-12-30 08:13:47 -07:00