android_kernel_lge_bullhead/drivers/vfio/pci
Vlad Tsyrklevich 37ccd2be0e vfio/pci: Fix integer overflows, bitmask check
commit 05692d7005a364add85c6e25a6c4447ce08f913a upstream.

The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize
user-supplied integers, potentially allowing memory corruption. This
patch adds appropriate integer overflow checks, checks the range bounds
for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element
in the VFIO_IRQ_SET_DATA_TYPE_MASK bitmask is set.
VFIO_IRQ_SET_ACTION_TYPE_MASK is already correctly checked later in
vfio_pci_set_irqs_ioctl().

Furthermore, a kzalloc is changed to a kcalloc because the use of a
kzalloc with an integer multiplication allowed an integer overflow
condition to be reached without this patch. kcalloc checks for overflow
and should prevent a similar occurrence.

Signed-off-by: Vlad Tsyrklevich <vlad@tsyrklevich.net>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-06-20 14:04:13 +02:00
..
Kconfig drivers/vfio: remove depends on CONFIG_EXPERIMENTAL 2013-02-24 09:59:44 -07:00
Makefile
vfio_pci.c vfio/pci: Fix integer overflows, bitmask check 2017-06-20 14:04:13 +02:00
vfio_pci_config.c vfio updates for v3.10 2013-05-02 14:02:32 -07:00
vfio_pci_intrs.c vfio/pci: Fix integer overflows, bitmask check 2017-06-20 14:04:13 +02:00
vfio_pci_private.h VFIO-AER: Vfio-pci driver changes for supporting AER 2013-03-11 09:31:22 -06:00
vfio_pci_rdwr.c vfio-pci: Add support for VGA region access 2013-02-18 10:11:13 -07:00