Commit aab439ff authored by Dan Carpenter's avatar Dan Carpenter Committed by Alex Williamson
Browse files

vfio/pci: clean up a type in vfio_pci_ioctl_pci_hot_reset_groups()



The "array_count" value comes from the copy_from_user() in
vfio_pci_ioctl_pci_hot_reset().  If the user passes a value larger than
INT_MAX then we'll pass a negative value to kcalloc() which triggers an
allocation failure and a stack trace.

It's better to make the type unsigned so that if (array_count > count)
returns -EINVAL instead.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/262ada03-d848-4369-9c37-81edeeed2da2@stanley.mountain


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 27a8204b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment