linux/drivers/media
Vladis Dronov 25516ba525 usbvision: revert commit 588afcc1
commit d5468d7afa upstream.

Commit 588afcc1c0 ("[media] usbvision fix overflow of interfaces
array")' should be reverted, because:

* "!dev->actconfig->interface[ifnum]" won't catch a case where the value
is not NULL but some garbage. This way the system may crash later with
GPF.

* "(ifnum >= USB_MAXINTERFACES)" does not cover all the error
conditions. "ifnum" should be compared to "dev->actconfig->
desc.bNumInterfaces", i.e. compared to the number of "struct
usb_interface" kzalloc()-ed, not to USB_MAXINTERFACES.

* There is a "struct usb_device" leak in this error path, as there is
usb_get_dev(), but no usb_put_dev() on this path.

* There is a bug of the same type several lines below with number of
endpoints. The code is accessing hard-coded second endpoint
("interface->endpoint[1].desc") which may not exist. It would be great
to handle this in the same patch too.

* All the concerns above are resolved by already-accepted commit fa52bd50
("[media] usbvision: fix crash on detecting device with invalid
configuration")

* Mailing list message:
http://www.spinics.net/lists/linux-media/msg94832.html

Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:17:39 +00:00
..
common [media] siano: add support for PCTV 77e 2014-11-17 14:11:49 +00:00
dvb-core media: dvb_ringbuffer: Add memory barriers 2016-11-20 01:16:48 +00:00
dvb-frontends [media] tda1004x: only update the frontend properties if locked 2016-02-25 10:34:35 +00:00
firewire firewire: introduce fw_driver.probe and .remove methods 2013-06-09 18:15:00 +02:00
i2c adv7511: TX_EDID_PRESENT is still 1 after a disconnect 2016-05-01 00:05:48 +02:00
mmc [media] siano: get rid of CammelCase from smscoreapi.h 2013-03-21 10:03:16 -03:00
parport [media] media: parport: Fix format string mismatch in bw-qcam.c 2014-05-23 12:18:53 -03:00
pci ngene: properly handle __user ptr 2016-11-20 01:16:48 +00:00
platform s5p-mfc: Add release callback for memory region devs 2016-11-20 01:16:39 +00:00
radio [media] si4713: fix Kconfig dependencies 2014-03-28 18:06:55 -03:00
rc [media] rc: allow rc modules to be loaded if rc-main is not a module 2016-02-02 19:10:10 +00:00
tuners xc2028: unlock on error in xc2028_set_config() 2016-05-01 00:05:46 +02:00
usb usbvision: revert commit 588afcc1 2016-11-20 01:17:39 +00:00
v4l2-core media: v4l2-compat-ioctl32: fix missing length copy in put_v4l2_buffer32 2016-05-01 00:05:45 +02:00
Kconfig [media] subdev autoselect only works if I2C and I2C_MUX is selected 2013-12-21 06:03:06 -02:00
Makefile [media] move i2c files into drivers/media/i2c 2012-09-06 18:42:54 -03:00
media-device.c media: media-device: Remove duplicated memset() in media_enum_entities() 2014-09-17 09:21:49 -07:00
media-devnode.c [media] media: Use a better owner for the media device 2014-05-13 13:39:00 -03:00
media-entity.c [media] media: Check for active links on pads with MEDIA_PAD_FL_MUST_CONNECT flag 2013-12-04 15:03:45 -02:00