1
0
Fork 0
alistair23-linux/drivers/media/usb
Johan Hovold e7cd85f398 media: xirlink_cit: add missing descriptor sanity checks
commit a246b4d547 upstream.

Make sure to check that we have two alternate settings and at least one
endpoint before accessing the second altsetting structure and
dereferencing the endpoint arrays.

This specifically avoids dereferencing NULL-pointers or corrupting
memory when a device does not have the expected descriptors.

Note that the sanity check in cit_get_packet_size() is not redundant as
the driver is mixing looking up altsettings by index and by number,
which may not coincide.

Fixes: 659fefa0eb ("V4L/DVB: gspca_xirlink_cit: Add support for camera with a bcd version of 0.01")
Fixes: 59f8b0bf3c ("V4L/DVB: gspca_xirlink_cit: support bandwidth changing for devices with 1 alt setting")
Cc: stable <stable@vger.kernel.org>     # 2.6.37
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-01 11:02:18 +02:00
..
airspy media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
as102 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118 2019-05-24 17:39:02 +02:00
au0828 media: drivers/media: don't set pix->priv = 0 2019-07-23 08:48:33 -04:00
b2c2 media: flexcop-usb: fix endpoint sanity check 2020-04-01 11:02:15 +02:00
cpia2 media: cpia2_usb: fix memory leaks 2019-08-26 10:40:01 -03:00
cx231xx media: usb: cx231xx-417: fix a memory leak bug 2019-08-26 10:40:17 -03:00
dvb-usb media: dib0700: fix rc endpoint lookup 2020-04-01 11:02:17 +02:00
dvb-usb-v2 media: dvbsky: add support for eyeTV Geniatech T2 lite 2020-02-01 09:34:47 +00:00
em28xx media: em28xx: Fix exception handling in em28xx_alloc_urbs() 2019-08-29 10:22:20 -03:00
go7007 media: usb: go7007: s2250-board: convert to i2c_new_dummy_device 2019-08-13 11:46:13 -03:00
gspca media: xirlink_cit: add missing descriptor sanity checks 2020-04-01 11:02:18 +02:00
hackrf Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
hdpvr media: hdpvr: remove redundant assignment to retval 2019-08-26 10:43:53 -03:00
msi2500 media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
pulse8-cec media: pulse8-cec: fix lost cec_transmit_attempt_done() call 2020-01-09 10:19:56 +01:00
pvrusb2 media: pvrusb2: Fix oops on tear-down when radio support is not present 2019-12-31 16:45:10 +01:00
pwc media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
rainshadow-cec treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 55 2019-05-24 17:36:42 +02:00
s2255 media: drivers/media: don't set pix->priv = 0 2019-07-23 08:48:33 -04:00
siano USB fixes for 5.2-rc3 2019-05-31 08:16:31 -07:00
stk1160 media: media/usb: don't set description in ENUM_FMT 2019-07-22 14:01:05 -04:00
stkwebcam media: stkwebcam: fix runtime PM after driver unbind 2019-10-04 14:38:46 +02:00
tm6000 media: Fix various misspellings of disconnected 2019-08-19 12:02:28 -03:00
ttusb-budget treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ttusb-dec media: ttusb-dec: Fix info-leak in ttusb_dec_send_command() 2019-08-21 18:39:55 -03:00
usbtv media: usbtv: fix control-message timeouts 2020-04-01 11:02:16 +02:00
usbvision media: usbvision: Fix races among open, close, and disconnect 2019-11-29 10:10:06 +01:00
uvc media: uvcvideo: Add a quirk to force GEO GC6500 Camera bits-per-pixel value 2020-02-24 08:36:56 +01:00
zr364xx media: media/usb: Use kmemdup rather than duplicating its implementation 2019-08-14 05:02:43 -03:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00