mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-11 08:47:17 -05:00
Merge tag 'vfio-v3.9-rc7' of git://github.com/awilliam/linux-vfio
Pull vfio overflow fix from Alex Williamson. * tag 'vfio-v3.9-rc7' of git://github.com/awilliam/linux-vfio: vfio-pci: Fix possible integer overflow
This commit is contained in:
@@ -346,6 +346,7 @@ static long vfio_pci_ioctl(void *device_data,
|
||||
|
||||
if (!(hdr.flags & VFIO_IRQ_SET_DATA_NONE)) {
|
||||
size_t size;
|
||||
int max = vfio_pci_get_irq_count(vdev, hdr.index);
|
||||
|
||||
if (hdr.flags & VFIO_IRQ_SET_DATA_BOOL)
|
||||
size = sizeof(uint8_t);
|
||||
@@ -355,7 +356,7 @@ static long vfio_pci_ioctl(void *device_data,
|
||||
return -EINVAL;
|
||||
|
||||
if (hdr.argsz - minsz < hdr.count * size ||
|
||||
hdr.count > vfio_pci_get_irq_count(vdev, hdr.index))
|
||||
hdr.start >= max || hdr.start + hdr.count > max)
|
||||
return -EINVAL;
|
||||
|
||||
data = memdup_user((void __user *)(arg + minsz),
|
||||
|
||||
Reference in New Issue
Block a user