1
0
Fork 0
remarkable-linux/drivers/vfio
Michael S. Tsirkin 1590808b43 vfio: fix ioctl error handling
[ Upstream commit 8160c4e455 ]

Calling return copy_to_user(...) in an ioctl will not
do the right thing if there's a pagefault:
copy_to_user returns the number of bytes not copied
in this case.

Fix up vfio to do
	return copy_to_user(...)) ?
		-EFAULT : 0;

everywhere.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-03-09 13:15:13 -05:00
..
pci vfio: fix ioctl error handling 2016-03-09 13:15:13 -05:00
platform vfio: fix ioctl error handling 2016-03-09 13:15:13 -05:00
Kconfig vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00
Makefile vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00
vfio.c vfio: Fix runaway interruptible timeout 2015-05-01 16:31:41 -06:00
vfio_iommu_spapr_tce.c drivers/vfio: EEH support for VFIO PCI device 2014-08-05 15:28:48 +10:00
vfio_iommu_type1.c vfio: fix ioctl error handling 2016-03-09 13:15:13 -05:00
vfio_spapr_eeh.c drivers/vfio: Export vfio_spapr_iommu_eeh_ioctl() with GPL 2014-09-29 10:31:51 -06:00
virqfd.c vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00