android_kernel_oneplus_msm8998/drivers/media
Vladis Dronov af521c7f82 usbvision: revert commit 588afcc1
[ Upstream commit d5468d7afaa9c9e961e150f0455a14a9f4872a98 ]

Commit 588afcc1c0e4 ("[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>
Cc: <stable@vger.kernel.org>      # for v4.5
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-10 07:41:36 -08:00
..
common media: siano: get rid of __le32/__le16 cast warnings 2018-08-06 16:24:37 +02:00
dvb-core media: dvb_frontend: fix locking issues at dvb_frontend_get_event() 2018-07-03 11:21:33 +02:00
dvb-frontends media: [RESEND] media: dvb-frontends: Add delay to Si2168 restart 2018-03-24 10:58:47 +01:00
firewire [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
i2c media: soc_camera: ov772x: correct setting of banding filter 2018-10-10 08:52:05 +02:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci media: saa7164: Fix driver name in debug output 2018-08-06 16:24:36 +02:00
platform media: omap3isp: zero-initialize the isp cam_xclk{a,b} initial data 2018-10-10 08:52:06 +02:00
radio media: si470x: fix __be16 annotations 2018-08-06 16:24:39 +02:00
rc mceusb: sporadic RX truncation corruption fix 2018-04-13 19:50:18 +02:00
tuners media: r820t: fix r820t_write_reg for KASAN 2018-02-22 15:45:02 +01:00
usb usbvision: revert commit 588afcc1 2018-11-10 07:41:36 -08:00
v4l2-core media: v4l: event: Prevent freeing event subscriptions while accessed 2018-10-10 08:52:10 +02:00
Kconfig media updates for v4.2-rc1 2015-06-25 17:55:48 -07:00
Makefile
media-device.c
media-devnode.c
media-entity.c [media] media-entity.c: get rid of var length arrays 2015-10-01 18:10:05 -03:00