vfio-mdev: buffer overflow in ioctl()
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 7 Jan 2017 06:28:40 +0000 (09:28 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 11 Jan 2017 19:12:29 +0000 (12:12 -0700)
commit5c677869e0abbffbade2cfd82d46d0eebe823f34
tree7f4659715113784f3c88cd1dc61414b0fcecf37e
parent6ed0993a0b859ce62edf2930ded683e452286d39
vfio-mdev: buffer overflow in ioctl()

This is a sample driver for documentation so the impact is probably
pretty low.  But we should check that bar_index is valid so we
don't write beyond the end of the mdev_state->region_info[] array.

Fixes: 9d1a546c53b4 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Kirti Wankhede <kwankhede@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
samples/vfio-mdev/mtty.c