]> git.baikalelectronics.ru Git - kernel.git/commit
vfio-pci: Fix possible integer overflow
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 26 Mar 2013 17:33:16 +0000 (11:33 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 26 Mar 2013 17:33:16 +0000 (11:33 -0600)
commit4796c15cc4e2b6cc3c3f42b6d7b542c484b9c83b
treec1f3e2c8ba7fb2e5f96070f8125003730a71d222
parenta0537fe911ce4b6442a22a7176abc9742d546e47
vfio-pci: Fix possible integer overflow

The VFIO_DEVICE_SET_IRQS ioctl takes a start and count parameter, both
of which are unsigned.  We attempt to bounds check these, but fail to
account for the case where start is a very large number, allowing
start + count to wrap back into the valid range.  Bounds check both
start and start + count.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci.c