]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usbvision fix overflow of interfaces array
authorOliver Neukum <oneukum@suse.com>
Tue, 27 Oct 2015 11:51:34 +0000 (09:51 -0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Mar 2016 13:25:39 +0000 (14:25 +0100)
commit 588afcc1c0e45358159090d95bf7b246fb67565f upstream.

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>
[bwh: Backported to 2.6.32: adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/media/video/usbvision/usbvision-video.c

index a2a50d608a3fd0d061b655119cbf8d4627b0be05..1ebe22b169baeb2bed791b6dd861bfa59c32ad5f 100644 (file)
@@ -1651,6 +1651,13 @@ static int __devinit usbvision_probe(struct usb_interface *intf,
        printk(KERN_INFO "%s: %s found\n", __func__,
                                usbvision_device_data[model].ModelString);
 
+       /*
+        * 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 {