summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/usbvision/usbvision-video.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2015-10-27 12:51:34 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-11-17 17:56:31 +0100
commit588afcc1c0e45358159090d95bf7b246fb67565f (patch)
treece527d3f473b71cd398912d3876acc1ae4350bfc /drivers/media/usb/usbvision/usbvision-video.c
parent[media] sh-vou: clarify videobuf2 dependency (diff)
downloadlinux-588afcc1c0e45358159090d95bf7b246fb67565f.tar.xz
linux-588afcc1c0e45358159090d95bf7b246fb67565f.zip
[media] usbvision fix overflow of interfaces array
This fixes the crash reported in: http://seclists.org/bugtraq/2015/Oct/35 The interface number needs a sanity check. Signed-off-by: Oliver Neukum <oneukum@suse.com> Cc: Vladis Dronov <vdronov@redhat.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/usbvision/usbvision-video.c')
-rw-r--r--drivers/media/usb/usbvision/usbvision-video.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c
index 4aa46caf7e22..3089d640c82d 100644
--- a/drivers/media/usb/usbvision/usbvision-video.c
+++ b/drivers/media/usb/usbvision/usbvision-video.c
@@ -1461,6 +1461,13 @@ static int usbvision_probe(struct usb_interface *intf,
printk(KERN_INFO "%s: %s found\n", __func__,
usbvision_device_data[model].model_string);
+ /*
+ * this is a security check.
+ * an exploit using an incorrect bInterfaceNumber is known
+ */
+ if (ifnum >= USB_MAXINTERFACES || !dev->actconfig->interface[ifnum])
+ return -ENODEV;
+
if (usbvision_device_data[model].interface >= 0)
interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
else