android_kernel_samsung_a7y1.../drivers/media
Johan Hovold dcee9669fa media: xirlink_cit: add missing descriptor sanity checks
commit a246b4d547708f33ff4d4b9a7a5dbac741dc89d8 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: 659fefa0eb17 ("V4L/DVB: gspca_xirlink_cit: Add support for camera with a bcd version of 0.01")
Fixes: 59f8b0bf3c12 ("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-07 14:25:04 +02:00
..
common A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dvb-core A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dvb-frontends tua6100: Avoid build warnings. 2020-04-06 19:54:33 +02:00
firewire A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
i2c media: i2c: mt9v032: fix enum mbus codes and frame sizes 2020-04-07 13:55:40 +02:00
isdbt A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mmc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci media: cx23885: check allocation return 2020-04-07 13:41:03 +02:00
platform media: sti: bdisp: fix a possible sleep-in-atomic-context bug in bdisp_device_run() 2020-04-07 13:55:42 +02:00
radio media: si470x-i2c: Move free() past last use of 'radio' 2020-04-07 13:48:31 +02:00
rc media: iguanair: fix endpoint sanity check 2020-04-07 13:49:13 +02:00
tdmb A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tuners A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usb media: xirlink_cit: add missing descriptor sanity checks 2020-04-07 14:25:04 +02:00
v4l2-core media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE 2020-04-07 12:43:22 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
m2m1shot-helper.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
m2m1shot-testdev.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
m2m1shot.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
m2m1shot2-testdev.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
m2m1shot2.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
media-device.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
media-devnode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
media-entity.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30