From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161023AbcFEWaP (ORCPT ); Sun, 5 Jun 2016 18:30:15 -0400 Received: from plane.gmane.org ([80.91.229.3]:56970 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544AbcFEWaL (ORCPT ); Sun, 5 Jun 2016 18:30:11 -0400 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: Holger =?iso-8859-1?q?Hoffst=E4tte?= Subject: Re: [PATCH 4.4 63/99] [media] usbvision fix overflow of interfaces array Date: Sun, 5 Jun 2016 21:53:42 +0000 (UTC) Message-ID: References: <20160605213902.974592018@linuxfoundation.org> <20160605213909.221089135@linuxfoundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pd953e4e5.dip0.t-ipconnect.de User-Agent: Pan/0.140 (Chocolate Salty Balls; GIT b8fc14e git.gnome.org/git/pan2) Cc: stable@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 05 Jun 2016 14:41:36 -0700, Greg Kroah-Hartman wrote: > 4.4-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Oliver Neukum > > 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 > Cc: Vladis Dronov > Signed-off-by: Hans Verkuil > Signed-off-by: Mauro Carvalho Chehab > Cc: Moritz Muehlenhoff > Signed-off-by: Greg Kroah-Hartman > > --- > drivers/media/usb/usbvision/usbvision-video.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > --- 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_in > 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 if (ifnum < dev->actconfig->desc.bNumInterfaces) Not sure if it matters, but heads up anyway that for some reason this patch is a duplicate and was previously applied quite some time ago: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?h=linux-4.4.y&id=588afcc1c0e45358159090d95bf7b246fb67565f -h