android_kernel_samsung_a7y1.../drivers/media/usb
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
..
airspy
as102
au0828
b2c2 media: flexcop-usb: fix endpoint sanity check 2020-04-07 14:24:47 +02:00
cpia2
cx231xx
dvb-usb media: dib0700: fix rc endpoint lookup 2020-04-07 14:25:00 +02:00
dvb-usb-v2
em28xx
go7007
gspca media: xirlink_cit: add missing descriptor sanity checks 2020-04-07 14:25:04 +02:00
hackrf
hdpvr
msi2500
pvrusb2 media: pvrusb2: Fix oops on tear-down when radio support is not present 2020-04-07 13:21:24 +02:00
pwc
s2255
siano
stk1160
stkwebcam
tm6000
ttusb-budget
ttusb-dec
usbtv media: usbtv: fix control-message timeouts 2020-04-07 14:24:49 +02:00
usbvision
uvc media: uvcvideo: Avoid cyclic entity chains due to malformed USB descriptors 2020-04-07 13:49:31 +02:00
zr364xx media: usb:zr364xx:Fix KASAN:null-ptr-deref Read in zr364xx_vidioc_querycap 2020-04-07 13:36:20 +02:00
Kconfig
Makefile